Thanks for the update. This is actually something we're looking at - @opichals has already added support for using 'Terser' to GitHub. It's not available in the default Web IDE yet but I'll hopefully do a new IDE release that includes it really soon now.
The issue you're having is that 'Modules as Functions' inserts the modules into the main code as functions rather than Strings, which means the minifier actually starts minifying them and you get the errors.
You'd hope that closure could be configured to allow certain bits of ES6 but not others, but I haven't been able to do that yet. Perhaps just having a beta option to run Closure with ES6 output would be fine for most cases.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Thanks for the update. This is actually something we're looking at - @opichals has already added support for using 'Terser' to GitHub. It's not available in the default Web IDE yet but I'll hopefully do a new IDE release that includes it really soon now.
The issue you're having is that 'Modules as Functions' inserts the modules into the main code as functions rather than Strings, which means the minifier actually starts minifying them and you get the errors.
You'd hope that closure could be configured to allow certain bits of ES6 but not others, but I haven't been able to do that yet. Perhaps just having a beta option to run Closure with ES6 output would be fine for most cases.