Replaced uglifyjs w/ webpack 5 TerserPlugin.

This commit is contained in:
2020-11-24 23:42:05 +01:00
parent 7bebe07db6
commit 81ce466318
3 changed files with 9 additions and 11 deletions

View File

@@ -6,7 +6,8 @@ const webpack = require("webpack");
const merge = require("webpack-merge");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const MiniCSSExtractPlugin = require("mini-css-extract-plugin");
const UglifyJSPlugin = require("uglifyjs-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const helpers = require("./helpers");
const commonConfig = require("./webpack.config.common");
const isProd = process.env.NODE_ENV === "production";
@@ -33,16 +34,15 @@ const webpackConfig = merge(commonConfig(false), {
}
}
},
minimize: true,
minimizer: [
new OptimizeCSSAssetsPlugin({
cssProcessorPluginOptions: {
preset: ["default", { discardComments: { removeAll: true } }]
}
}),
new UglifyJSPlugin({
cache: true,
parallel: false,
sourceMap: !isProd
new TerserPlugin({
test: /\.js(\?.*)?$/i,
})
]
},