Reputation: 25
I have a lot of old JavaScript. I have yesterday started using webpack to help split up JavaScript into files that are seperated and it works. I want to upgrade the code to ES6, and having all the JavaScripts seperate I hope to upgrade the coding one file at a time.
How best do I make this? I understand that Babel is required, but it is important that I can mix old JavaScripts with new ES6 scripts while upgrading the code, and they happily work together.
Please accept my apologies for my bad English, and thank you very much for any advice you can send.
Upvotes: 0
Views: 697
Reputation: 2639
Old JS code will already work in ES6+/Babel, you could just make slight modifications to variables, methods and classes to export them and make them available in other files. https://babeljs.io/docs/learn-es2015/#modules
Upvotes: 1