@@ -21,6 +21,7 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
21
21
const paths = require ( './paths' ) ;
22
22
const getClientEnvironment = require ( './env' ) ;
23
23
const TsconfigPathsPlugin = require ( 'tsconfig-paths-webpack-plugin' ) ;
24
+ const UglifyJsPlugin = require ( 'uglifyjs-webpack-plugin' ) ;
24
25
25
26
// Webpack uses `publicPath` to determine where the app is being served from.
26
27
// It requires a trailing slash, or the file assets will get an incorrect path.
@@ -296,23 +297,28 @@ module.exports = {
296
297
// Otherwise React will be compiled in the very slow development mode.
297
298
new webpack . DefinePlugin ( env . stringified ) ,
298
299
// Minify the code.
299
- new webpack . optimize . UglifyJsPlugin ( {
300
- compress : {
301
- warnings : false ,
302
- // Disabled because of an issue with Uglify breaking seemingly valid code:
303
- // https://github.com/facebookincubator/create-react-app/issues/2376
304
- // Pending further investigation:
305
- // https://github.com/mishoo/UglifyJS2/issues/2011
306
- comparisons : false ,
307
- } ,
308
- mangle : {
309
- safari10 : true ,
310
- } ,
311
- output : {
312
- comments : false ,
313
- // Turned on because emoji and regex is not minified properly using default
314
- // https://github.com/facebookincubator/create-react-app/issues/2488
315
- ascii_only : true ,
300
+ new UglifyJsPlugin ( {
301
+ parallel : true ,
302
+ cache : true ,
303
+ uglifyOptions : {
304
+ ecma : 8 ,
305
+ compress : {
306
+ warnings : false ,
307
+ // Disabled because of an issue with Uglify breaking seemingly valid code:
308
+ // https://github.com/facebookincubator/create-react-app/issues/2376
309
+ // Pending further investigation:
310
+ // https://github.com/mishoo/UglifyJS2/issues/2011
311
+ comparisons : false ,
312
+ } ,
313
+ mangle : {
314
+ safari10 : true ,
315
+ } ,
316
+ output : {
317
+ comments : false ,
318
+ // Turned on because emoji and regex is not minified properly using default
319
+ // https://github.com/facebookincubator/create-react-app/issues/2488
320
+ ascii_only : true ,
321
+ } ,
316
322
} ,
317
323
sourceMap : shouldUseSourceMap ,
318
324
} ) ,
0 commit comments