File tree Expand file tree Collapse file tree 5 files changed +11
-11
lines changed Expand file tree Collapse file tree 5 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,11 @@ module.exports = function printBuildError(err) {
1313 const message = err != null && err . message ;
1414 const stack = err != null && err . stack ;
1515
16- // Add more helpful message for UglifyJs error
16+ // Add more helpful message for Terser error
1717 if (
1818 stack &&
1919 typeof message === 'string' &&
20- message . indexOf ( 'from UglifyJs ' ) !== - 1
20+ message . indexOf ( 'from Terser ' ) !== - 1
2121 ) {
2222 try {
2323 const matched = / ( .+ ) \[ ( .+ ) : ( .+ ) , ( .+ ) \] \[ .+ \] / . exec ( stack ) ;
Original file line number Diff line number Diff line change 6060 "rimraf" : " ^2.6.2" ,
6161 "settle-promise" : " 1.0.0" ,
6262 "source-map" : " 0.5.6" ,
63- "uglifyjs -webpack-plugin" : " 1.2.5 " ,
63+ "terser -webpack-plugin" : " ^1.0.0 " ,
6464 "webpack" : " ^4.8.1"
6565 },
6666 "jest" : {
Original file line number Diff line number Diff line change 88
99const path = require ( 'path' ) ;
1010const webpack = require ( 'webpack' ) ;
11- const UglifyJsPlugin = require ( 'uglifyjs -webpack-plugin' ) ;
11+ const TerserPlugin = require ( 'terser -webpack-plugin' ) ;
1212
1313module . exports = {
1414 mode : process . env . NODE_ENV === 'production' ? 'production' : 'development' ,
@@ -49,8 +49,8 @@ module.exports = {
4949 minimizer : [
5050 // This code is embedded as a string, so it would never be optimized
5151 // elsewhere.
52- new UglifyJsPlugin ( {
53- uglifyOptions : {
52+ new TerserPlugin ( {
53+ terserOptions : {
5454 compress : {
5555 warnings : false ,
5656 comparisons : false ,
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const autoprefixer = require('autoprefixer');
1212const path = require ( 'path' ) ;
1313const webpack = require ( 'webpack' ) ;
1414const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
15- const UglifyJsPlugin = require ( 'uglifyjs -webpack-plugin' ) ;
15+ const TerserPlugin = require ( 'terser -webpack-plugin' ) ;
1616const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' ) ;
1717const OptimizeCSSAssetsPlugin = require ( 'optimize-css-assets-webpack-plugin' ) ;
1818const ManifestPlugin = require ( 'webpack-manifest-plugin' ) ;
@@ -116,10 +116,10 @@ module.exports = {
116116 } ,
117117 optimization : {
118118 minimizer : [
119- new UglifyJsPlugin ( {
120- uglifyOptions : {
119+ new TerserPlugin ( {
120+ terserOptions : {
121121 parse : {
122- // we want uglify-js to parse ecma 8 code. However, we don't want it
122+ // we want terser to parse ecma 8 code. However, we don't want it
123123 // to apply any minfication steps that turns valid ecma 5 code
124124 // into invalid ecma 5 code. This is why the 'compress' and 'output'
125125 // sections only apply transformations that are ecma 5 safe
Original file line number Diff line number Diff line change 6565 "svgr" : " 1.9.2" ,
6666 "sw-precache-webpack-plugin" : " 0.11.5" ,
6767 "thread-loader" : " 1.1.5" ,
68- "uglifyjs -webpack-plugin" : " 1.2.5 " ,
68+ "terser -webpack-plugin" : " ^1.0.0 " ,
6969 "url-loader" : " 1.0.1" ,
7070 "webpack" : " 4.8.3" ,
7171 "webpack-dev-server" : " 3.1.7" ,
You can’t perform that action at this time.
0 commit comments