@@ -19,6 +19,7 @@ const ManifestPlugin = require('webpack-manifest-plugin');
19
19
const InterpolateHtmlPlugin = require ( 'react-dev-utils/InterpolateHtmlPlugin' ) ;
20
20
const SWPrecacheWebpackPlugin = require ( 'sw-precache-webpack-plugin' ) ;
21
21
const ModuleScopePlugin = require ( 'react-dev-utils/ModuleScopePlugin' ) ;
22
+ const UglifyJsPlugin = require ( 'uglifyjs-webpack-plugin' ) ;
22
23
const paths = require ( './paths' ) ;
23
24
const getClientEnvironment = require ( './env' ) ;
24
25
@@ -165,7 +166,7 @@ module.exports = {
165
166
{
166
167
test : / \. ( t s | t s x ) $ / ,
167
168
include : paths . appSrc ,
168
- loader : require . resolve ( 'ts-loader' )
169
+ loader : require . resolve ( 'ts-loader' ) ,
169
170
} ,
170
171
// The notation here is somewhat confusing.
171
172
// "postcss" loader applies autoprefixer to our CSS.
@@ -272,20 +273,17 @@ module.exports = {
272
273
// Otherwise React will be compiled in the very slow development mode.
273
274
new webpack . DefinePlugin ( env . stringified ) ,
274
275
// Minify the code.
275
- new webpack . optimize . UglifyJsPlugin ( {
276
- compress : {
277
- warnings : false ,
278
- // Disabled because of an issue with Uglify breaking seemingly valid code:
279
- // https://github.com/facebookincubator/create-react-app/issues/2376
280
- // Pending further investigation:
281
- // https://github.com/mishoo/UglifyJS2/issues/2011
282
- comparisons : false ,
283
- } ,
284
- output : {
285
- comments : false ,
286
- // Turned on because emoji and regex is not minified properly using default
287
- // https://github.com/facebookincubator/create-react-app/issues/2488
288
- ascii_only : true ,
276
+ new UglifyJsPlugin ( {
277
+ //test: /.js($|?)/i //Do we need to change this for ts-loader output?
278
+ parallel : true ,
279
+ uglifyOptions : {
280
+ ecma : 6 ,
281
+ output : {
282
+ comments : false ,
283
+ // Turned on because emoji and regex is not minified properly using default
284
+ // https://github.com/facebookincubator/create-react-app/issues/2488
285
+ ascii_only : true ,
286
+ } ,
289
287
} ,
290
288
sourceMap : shouldUseSourceMap ,
291
289
} ) ,
0 commit comments