-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v4.0.0.rc.*: Configuring Babel to target esmodules incorrectly generates ES5 instead of ES6 #1892
Comments
I'm guessing this change is the cause:
And that this rule is being applied to the application's |
Confirmed. Removing that loader ( |
New `nodeModules` loader significantly change behavior. It's specified in **Breaking changes** section but description is quite small. As example, @javan have issue with `nodeModules` loader (rails#1892). Also, in my build it breaks `mapbox-gl` package (mapbox/mapbox-gl-js#3422). This PR adds more details to `CHANGELOG.md` about `nodeModules` loader and receipt to keep previous behavior.
Relevant article from Babel: https://babeljs.io/blog/2018/06/26/on-consuming-and-publishing-es2015+-packages Edit to clarify: I was not in favor of forcing all .js files to compile to ES5. There’s safety in numbers and webpacker should cater to how packages were intended to be consumed. |
I understand the motivation behind compiling .js in |
Using the following source
app/javascript/packs/application.js
file:With Webpacker v4.0.0.pre.3, I could configure Babel to compile ES6 by targeting
{ "esmodules": true }
:.babelrc
public/packs/application.js
With Webpacker v4.0.0.rc.2, this no longer works:
babel.config.js
public/packs/application.js
The text was updated successfully, but these errors were encountered: