Skip to content

Commit

Permalink
[next] Revert to use ecma 5 in uglifyOptions (#4234)
Browse files Browse the repository at this point in the history
* Revert to use ecma 5 in uglifyOptions

* remove explicit ecma version from uglifyOptions settings

The defaults are already what we want

* be explicit of where we use ecma: 8 and ecma: 5
  • Loading branch information
danielberndt authored and Timer committed Apr 2, 2018
1 parent da518d2 commit 2824bf2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/react-scripts/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,15 @@ module.exports = {
// Minify the code.
new UglifyJsPlugin({
uglifyOptions: {
ecma: 8,
parse: {
// we want uglify-js to parse ecma 8 code. However we want it to output
// ecma 5 compliant code, to avoid issues with older browsers, this is
// whey we put `ecma: 5` to the compress and output section
// https://github.com/facebook/create-react-app/pull/4234
ecma: 8,
},
compress: {
ecma: 5,
warnings: false,
// Disabled because of an issue with Uglify breaking seemingly valid code:
// https://github.com/facebook/create-react-app/issues/2376
Expand All @@ -391,6 +398,7 @@ module.exports = {
safari10: true,
},
output: {
ecma: 5,
comments: false,
// Turned on because emoji and regex is not minified properly using default
// https://github.com/facebook/create-react-app/issues/2488
Expand Down

0 comments on commit 2824bf2

Please sign in to comment.