I have a Node.js app with all modules written in CommonJS and some using es6 features such as generators, let, const etc. And this all works fine as is.
I want to bundle all these files into one file and then uglify that. My best guess at the necessary steps are: 1) Convert all modules to es6 modules - using Babel 2) Use rollup to create the bundle and output it as a CJS file. 3) Uglify this CJS file.
I've played with rollup & babel and have read articles such as https://duske.me/easy-es2015-compilation-with-rollup-js-and-gulp-js/ which works fine if the input modules are already es6 modules. And I've looked at https://github.com/rollup/rollup-plugin-babel but am floundering as I don't have much experience with babel, rollup etc.