From 9f3b9ac3ccecee4b44f9fd8ae2aa03ea5d2ea7fd Mon Sep 17 00:00:00 2001 From: hectorgrebbell Date: Fri, 8 Mar 2019 13:08:13 +0000 Subject: [PATCH] Update default JS minimizer to Terser Webpack has moved to Terser so it feels like the documentation here should too https://github.com/webpack/webpack/pull/8036 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 072cb1ff..b2072976 100644 --- a/README.md +++ b/README.md @@ -121,13 +121,13 @@ While webpack 5 is likely to come with a CSS minimizer built-in, with webpack 4 **webpack.config.js** ```js -const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); +const TerserPlugin = require("terser-webpack-plugin"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); module.exports = { optimization: { minimizer: [ - new UglifyJsPlugin({ + new TerserPlugin({ cache: true, parallel: true, sourceMap: true // set to true if you want JS source maps