neutrinojs / neutrino

Create and build modern JavaScript projects with zero initial configuration.
https://neutrinojs.org
Mozilla Public License 2.0
3.94k stars 213 forks source link

@neutrinojs/library - compile to standard ES5 #781

Closed flash1293 closed 6 years ago

flash1293 commented 6 years ago

IMHO the library preset should configure babel to compile to standard ES5 to be consumable by uglify, incuding async/await and other language features.

eliperelman commented 6 years ago

I think this is reasonable, and I am thinking the same thing about react-components as well so they play well with CRA by default. The tradeoff here comes with the size expense.

@mozilla-neutrino/core-contributors thoughts?

edmorley commented 6 years ago

Or ideally compile to both - one for the project's main and the other for module.

eliperelman commented 6 years ago

See also #722.

eliperelman commented 6 years ago

one for the project's main and the other for module.

From what I've been reading, the current practice still seems to be compile to ES5 for both main and module, just that the main uses CJS and module uses ES imports.

That said, with the current master implementation you would need to run webpack twice or export an array of configs since there is no longer any fork middleware.

edmorley commented 6 years ago

This doesn't block a Neutrino v9 alpha - however since it's a breaking change, someone would need to start working on this soon or else it's not going to make Neutrino 9 final, and would then have to wait until Neutrino 10.