mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-20 18:06:11 -05:00
grab one minimizer rather than three
Apparently WebPack builds in "terser", which is what the cool kids use. Just go with the default and simplify the configuration as well as installing fewer node modules. "babel-minify-webpack-plugin" wasn't actually being used, and babel-minify is still in beta anyway. uglifyjs, according to https://github.com/webpack/webpack/issues/7923, doesn't support ES6 and depends on a package which is no longer maintained.
This commit is contained in:
@@ -54,33 +54,6 @@ module.exports = (env, args) => {
|
||||
},
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
{
|
||||
apply: (compiler) => {
|
||||
/**
|
||||
* Setup the UglifyJsPlugin as webpack4 does, plus options
|
||||
* we decide to override.
|
||||
*/
|
||||
// Lazy load the uglifyjs plugin
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
||||
new UglifyJsPlugin({
|
||||
cache: true, // webpack4: default
|
||||
parallel: true, // webpack4: default
|
||||
sourceMap: true,
|
||||
uglifyOptions: {
|
||||
compress: {
|
||||
keep_infinity: true, // Do not change to 1/0
|
||||
warnings: false, // Do not warn when dropping
|
||||
},
|
||||
output: {
|
||||
// Eliminate most comments, but not marked ones
|
||||
comments: 'some',
|
||||
},
|
||||
},
|
||||
}).apply(compiler);
|
||||
},
|
||||
},
|
||||
],
|
||||
splitChunks: {
|
||||
minSize: 30000,
|
||||
minChunks: 1,
|
||||
|
||||
Reference in New Issue
Block a user