I just updated to Webpack 2 and am receiving a runtime error exports is not defined
in the browser. I changed my .babelrc from this:
{
"plugins": [
"syntax-flow",
"transform-flow-strip-types",
"add-module-exports"
],
"presets": [
"latest",
"stage-2"
]
}
to this:
{
"plugins": [
"syntax-flow",
"transform-flow-strip-types",
"add-module-exports"
],
"presets": [
["latest", {
"es2015": {
"modules": false
}
}],
"stage-2"
]
}
To deactivate module import / export transpilation and leverage webpack 2's tree-shaking feature. Am I missing something? The build compiles correctly, but in the browser it just blows up.
TL;DR) Get rid of add-module-exports
To understand more about what's going on: https://ntucker.true.io/ntucker/webpack-2-uncaught-referenceerror-exports-is-not-defined/
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