Skip to content

Commit

Permalink
Switch from uglifyjs to terser (facebook#5026)
Browse files Browse the repository at this point in the history
Uglify is no longer maintained and has bugs not present in Terser (its successor)
  • Loading branch information
Timer authored Sep 18, 2018
1 parent 94e1b64 commit 8c2e3e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const autoprefixer = require('autoprefixer');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
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');
const ManifestPlugin = require('webpack-manifest-plugin');
Expand Down Expand Up @@ -115,10 +115,10 @@ module.exports = {
},
optimization: {
minimizer: [
new UglifyJsPlugin({
uglifyOptions: {
new TerserPlugin({
terserOptions: {
parse: {
// we want uglify-js to parse ecma 8 code. However, we don't want it
// we want terser to parse ecma 8 code. However, we don't want it
// to apply any minfication steps that turns valid ecma 5 code
// into invalid ecma 5 code. This is why the 'compress' and 'output'
// sections only apply transformations that are ecma 5 safe
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
"style-loader": "0.21.0",
"svgr": "1.9.2",
"sw-precache-webpack-plugin": "0.11.5",
"terser-webpack-plugin": "1.1.0",
"thread-loader": "1.2.0",
"uglifyjs-webpack-plugin": "1.2.5",
"url-loader": "1.0.1",
"webpack": "4.19.0",
"webpack-dev-server": "3.1.7",
Expand Down

0 comments on commit 8c2e3e4

Please sign in to comment.