Browse Source

Remove UglifyJS and explicitely opt-out from it

Uglify ES is to AVOID for all our projects. this create very sneaky bugs with React.
master
Gaëtan Renaudeau 7 years ago
parent
commit
11497ef7a3
  1. 2
      package.json
  2. 22
      webpack/renderer.config.js
  3. 2062
      yarn.lock

2
package.json

@ -32,7 +32,6 @@
}
},
"resolutions": {
"uglify-es": "3.3.7",
"webpack-sources": "1.0.1"
},
"dependencies": {
@ -157,7 +156,6 @@
"prettier": "^1.13.5",
"react-hot-loader": "^4.3.2",
"react-test-renderer": "^16.4.1",
"uglifyjs-webpack-plugin": "^1.2.6",
"webpack": "^4.6.0",
"webpack-bundle-analyzer": "^2.11.1",
"webpack-cli": "^2.0.14",

22
webpack/renderer.config.js

@ -1,29 +1,9 @@
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const plugins = require('./plugins')
const resolve = require('./resolve')
const rules = require('./rules')
const getOptimization = env => {
const optimization = {
minimizer: [
// Default Config without mangling
new UglifyJsPlugin({
parallel: true,
sourceMap: true,
uglifyOptions: {
mangle: false,
compress: {
ecma: 7,
},
},
}),
],
}
return env === 'production' ? optimization : undefined
}
const config = {
mode: __ENV__,
plugins: [...plugins('renderer'), new HardSourceWebpackPlugin()],
@ -35,7 +15,7 @@ const config = {
historyApiFallback: true,
},
optimization: {
...getOptimization(__ENV__),
minimizer: [],
},
}

2062
yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save