Move to webpack 4

This has uglification built in.

Closes #42
This commit is contained in:
Martin Pitt 2018-08-29 00:37:18 +02:00 committed by Lars Karlitski
parent 133badfa3d
commit 842a380766
2 changed files with 7 additions and 17 deletions

View file

@ -16,27 +16,28 @@
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-preset-env": "^1.5.2",
"chrome-remote-interface": "^0.25.5",
"compression-webpack-plugin": "~1.0.0",
"copy-webpack-plugin": "~3.0.1",
"compression-webpack-plugin": "^1.1.11",
"copy-webpack-plugin": "^4.5.2",
"css-loader": "^0.28.11",
"eslint": "^5.4.0",
"eslint-config-standard": "^11.0.0",
"eslint-config-standard-react": "^6.0.0",
"eslint-loader": "~1.6.1",
"eslint-loader": "^2.1.0",
"eslint-plugin-flowtype": "^2.50.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-promise": "^4.0.0",
"eslint-plugin-react": "^6.9.0",
"eslint-plugin-standard": "^3.1.0",
"extract-text-webpack-plugin": "^2.1.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"htmlparser": "^1.7.7",
"jed": "^1.1.1",
"po2json": "^0.4.5",
"sass-loader": "^7.0.3",
"sizzle": "^2.3.3",
"stdio": "^0.2.7",
"webpack": "^2.6.1"
"webpack": "^4.17.1",
"webpack-cli": "^3.1.0"
},
"dependencies": {
"node-sass": "^4.9.0",

View file

@ -78,24 +78,12 @@ info.files.forEach(function(value) {
info.files = files;
var plugins = [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify(production ? 'production' : 'development')
}
}),
new copy(info.files),
new extract("[name].css")
];
/* Only minimize when in production mode */
if (production) {
plugins.unshift(new webpack.optimize.UglifyJsPlugin({
beautify: true,
compress: {
warnings: false
},
}));
/* Rename output files when minimizing */
output.filename = "[name].min.js";
@ -108,6 +96,7 @@ if (production) {
}
module.exports = {
mode: production ? 'production' : 'development',
entry: info.entries,
externals: externals,
output: output,