Skip to content

Commit

Permalink
Replace uglifyjs-webpack-plugin with terser-webpack-plugin
Browse files Browse the repository at this point in the history
For the same reasons as webpack/webpack#8036
Webpack will switch to terser by default for 5.x
  • Loading branch information
jakemarsden committed Oct 11, 2018
1 parent 959b02b commit 2e60ec1
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 5 deletions.
37 changes: 37 additions & 0 deletions webapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"resolve-url-loader": "2.3.1",
"sass-loader": "7.1.0",
"speed-measure-webpack-plugin": "1.2.2",
"uglifyjs-webpack-plugin": "1.3.0",
"terser-webpack-plugin": "1.1.0",
"webpack": "4.17.2",
"webpack-bundle-analyzer": "2.13.1",
"webpack-cli": "3.1.0"
Expand Down
8 changes: 4 additions & 4 deletions webapp/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const CompressionPlugin = require('compression-webpack-plugin');
const HtmlPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');

module.exports = function (env) {
const isForProd = env === 'production';
Expand Down Expand Up @@ -55,7 +55,7 @@ module.exports = function (env) {
minimize: isForProd,
minimizer: [
new OptimizeCssAssetsPlugin({ cssProcessor: cssnano }),
new UglifyJsPlugin({
new TerserPlugin({
cache: !isForProd,
extractComments: {
// Separate license comments from the main bundle and add a comment explaining where to find them
Expand All @@ -65,7 +65,7 @@ module.exports = function (env) {
},
parallel: true,
sourceMap: true,
uglifyOptions: {
terserOptions: {
compress: true,
mangle: true
}
Expand Down

0 comments on commit 2e60ec1

Please sign in to comment.