This repository was archived by the owner on Jan 26, 2019. It is now read-only.
File tree 1 file changed +17
-7
lines changed
packages/react-scripts/config
1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -298,14 +298,19 @@ module.exports = {
298
298
new webpack . DefinePlugin ( env . stringified ) ,
299
299
// Minify the code.
300
300
new UglifyJsPlugin ( {
301
- parallel : true ,
302
- cache : true ,
303
301
uglifyOptions : {
304
- ecma : 8 ,
302
+ parse : {
303
+ // we want uglify-js to parse ecma 8 code. However we want it to output
304
+ // ecma 5 compliant code, to avoid issues with older browsers, this is
305
+ // whey we put `ecma: 5` to the compress and output section
306
+ // https://github.com/facebook/create-react-app/pull/4234
307
+ ecma : 8 ,
308
+ } ,
305
309
compress : {
310
+ ecma : 5 ,
306
311
warnings : false ,
307
312
// Disabled because of an issue with Uglify breaking seemingly valid code:
308
- // https://github.com/facebookincubator /create-react-app/issues/2376
313
+ // https://github.com/facebook /create-react-app/issues/2376
309
314
// Pending further investigation:
310
315
// https://github.com/mishoo/UglifyJS2/issues/2011
311
316
comparisons : false ,
@@ -314,15 +319,20 @@ module.exports = {
314
319
safari10 : true ,
315
320
} ,
316
321
output : {
322
+ ecma : 5 ,
317
323
comments : false ,
318
324
// Turned on because emoji and regex is not minified properly using default
319
- // https://github.com/facebookincubator /create-react-app/issues/2488
325
+ // https://github.com/facebook /create-react-app/issues/2488
320
326
ascii_only : true ,
321
327
} ,
322
328
} ,
329
+ // Use multi-process parallel running to improve the build speed
330
+ // Default number of concurrent runs: os.cpus().length - 1
331
+ parallel : true ,
332
+ // Enable file caching
333
+ cache : true ,
323
334
sourceMap : shouldUseSourceMap ,
324
- } ) ,
325
- // Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.
335
+ } ) , // Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.
326
336
new ExtractTextPlugin ( {
327
337
filename : cssFilename ,
328
338
} ) ,
You can’t perform that action at this time.
0 commit comments