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

@ -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,