Created
February 20, 2019 08:37
-
-
Save luobotang/6a373a141bea8bc0f2fbdfadcb09841f to your computer and use it in GitHub Desktop.
DEMO - Error of assign to read only 'exports' of object - caused by webpack and @babel/preset-env with special config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
presets: [ | |
[ | |
'@babel/env', | |
{ | |
useBuiltIns: 'usage', | |
modules: false | |
} | |
] | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = x.toString() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "demo", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"build": "webpack" | |
}, | |
"keywords": [], | |
"author": "luobotang", | |
"license": "MIT", | |
"dependencies": { | |
"@babel/core": "^7.2.2", | |
"@babel/polyfill": "^7.2.5", | |
"@babel/preset-env": "^7.2.3", | |
"babel-loader": "^8.0.5", | |
"webpack": "^4.28.4", | |
"webpack-cli": "^3.2.1" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
mode: 'production', | |
entry: './src.js', | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
loader: 'babel-loader' | |
} | |
] | |
}, | |
optimization: { | |
minimize: false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment