-
-
Notifications
You must be signed in to change notification settings - Fork 452
Description
I'm submitting a feature request
Webpack Version:
>= 2.x
Babel Loader Version:
7.1.2
Current behavior:
I need to manually disable the modules feature of Babel like this:
test: /\.js$/,
use: {
loader: 'babel-loader',
options: {
presets: ['env', { modules: false }]
}
}To let webpack use its own ESM system.
Expected/desired behavior:
For webpack 2.x and higher, babel-loader can detect automatically that we don't want to use modules.
Sean said I had to mention loaderContext.version = 2 as a way to detect the new webpack version.
- What is the motivation / use case for changing the behavior?
Many people don't know this, and especially people who upgraded from webpack 1.x to >2.x often don't have this enabled (seen this a lot personally).
One problem with this is that it is a breaking change (or at least potentially), but at the long term I think it's worth it. One less configuration option for most people.
Open question: is there a valid use-case where you want to have modules on true in webpack 2?
cc'ing @hzoo and @TheLarkInn because I know you talked about this a few minutes ago with eachother 🥇
Related: #519