So far I haven't found any COMPLETE example on this. There are answers talking about babel-plugin-transform-strict-mode
, but no code about how it should be configured.
Can anybody provide a simple working code snippet for how to configure the babel loader to disable strict mode? Thanks
I'll add a simple config below.
Also note that if you use ES6 syntax (like import instead of require), webpack will automatically add "use strict" as all ES6 modules are expected to be strict mode code.
var config = {
entry: {
home: buildBundle( 'home' ),
},
output: {
path: BUILD_DIR,
filename: '[name]-bundle.js'
},
module : {
loaders : [
{
test: /\.js?/,
include: APP_DIR,
use: {
loader: 'babel-loader',
options: {
"presets": [
['es2015', {modules: false}]
],
}
},
exclude: /node_modules/
},
]
},
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With