Skip to content

Commit

Permalink
fix: switch to terser plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyrb committed Aug 30, 2019
1 parent b28a9dd commit b607533
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 166 deletions.
14 changes: 11 additions & 3 deletions config/webpack/webpack-prod.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const webpack = require('webpack');
const merge = require('./merge');
const baseConfig = require('./webpack-base');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');

const prodConfig = {
output: {
Expand All @@ -10,8 +10,16 @@ const prodConfig = {
mode: 'production',
optimization: {
minimizer: [
new UglifyJSPlugin({
sourceMap: true,
new TerserPlugin({
cache: true,
parallel: true,
sourceMap: true, // Must be set to true if using source-maps in production
terserOptions: {
// https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions
compress: {
drop_console: true,
},
},
}),
],
},
Expand Down
163 changes: 1 addition & 162 deletions 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"prettier": "1.18.x",
"semantic-release": "^15.13.24",
"shx": "^0.3.2",
"uglifyjs-webpack-plugin": "1.2.5",
"terser-webpack-plugin": "^1.4.1",
"webpack": "^4.35.2",
"webpack-cli": "^3.3.5",
"webpack-dev-server": "^3.7.2"
Expand Down

0 comments on commit b607533

Please sign in to comment.