Skip to content

Commit 8c2e3e4

Browse files
authored
Switch from uglifyjs to terser (facebook#5026)
Uglify is no longer maintained and has bugs not present in Terser (its successor)
1 parent 94e1b64 commit 8c2e3e4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

config/webpack.config.prod.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const autoprefixer = require('autoprefixer');
1212
const path = require('path');
1313
const webpack = require('webpack');
1414
const HtmlWebpackPlugin = require('html-webpack-plugin');
15-
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
15+
const TerserPlugin = require('terser-webpack-plugin');
1616
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
1717
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
1818
const ManifestPlugin = require('webpack-manifest-plugin');
@@ -115,10 +115,10 @@ module.exports = {
115115
},
116116
optimization: {
117117
minimizer: [
118-
new UglifyJsPlugin({
119-
uglifyOptions: {
118+
new TerserPlugin({
119+
terserOptions: {
120120
parse: {
121-
// we want uglify-js to parse ecma 8 code. However, we don't want it
121+
// we want terser to parse ecma 8 code. However, we don't want it
122122
// to apply any minfication steps that turns valid ecma 5 code
123123
// into invalid ecma 5 code. This is why the 'compress' and 'output'
124124
// sections only apply transformations that are ecma 5 safe

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
"style-loader": "0.21.0",
6565
"svgr": "1.9.2",
6666
"sw-precache-webpack-plugin": "0.11.5",
67+
"terser-webpack-plugin": "1.1.0",
6768
"thread-loader": "1.2.0",
68-
"uglifyjs-webpack-plugin": "1.2.5",
6969
"url-loader": "1.0.1",
7070
"webpack": "4.19.0",
7171
"webpack-dev-server": "3.1.7",

0 commit comments

Comments
 (0)