diff --git a/package.json b/package.json index 9943682..18b8740 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "sass": "^1.26.11", "sass-loader": "^10.0.2", "style-loader": "^1.2.1", - "uglifyjs-webpack-plugin": "^2.1.1", + "terser-webpack-plugin": "^4.2.2", "webpack": "^4.16.1", "webpack-command": "^0.5.0", "webpack-notifier": "^1.6.0" diff --git a/webpack.config.js b/webpack.config.js index 4d8d66c..9ce4a30 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,7 +6,7 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin"); // const WebpackChunkHash = require('webpack-chunk-hash'); const { CleanWebpackPlugin } = require('clean-webpack-plugin'); const WebpackNotifierPlugin = require('webpack-notifier'); -const UglifyJsPlugin = require('uglifyjs-webpack-plugin') +const TerserPlugin = require('terser-webpack-plugin'); const isProduction = process.env.NODE_ENV === 'production'; const useSourcemaps = !isProduction; @@ -137,8 +137,9 @@ const webpackConfig = { }), ], optimization: { + minimize: true, minimizer: [ - new UglifyJsPlugin({}) + new TerserPlugin() ] } };