Skip to content
This repository was archived by the owner on Dec 31, 2024. It is now read-only.

Commit 89b1509

Browse files
committed
update uglifyjs-webpack-plugin
1 parent e8a3e4b commit 89b1509

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

packages/react-scripts/config/webpack.config.prod.js

+18-15
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
const autoprefixer = require('autoprefixer');
1414
const path = require('path');
1515
const webpack = require('webpack');
16+
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
1617
const HtmlWebpackPlugin = require('html-webpack-plugin');
1718
const ExtractTextPlugin = require('extract-text-webpack-plugin');
1819
const ManifestPlugin = require('webpack-manifest-plugin');
@@ -287,21 +288,23 @@ module.exports = {
287288
// Otherwise React will be compiled in the very slow development mode.
288289
new webpack.DefinePlugin(env.stringified),
289290
// Minify the code.
290-
new webpack.optimize.UglifyJsPlugin({
291-
compress: {
292-
warnings: false,
293-
// Disabled because of an issue with Uglify breaking seemingly valid code:
294-
// https://github.com/facebookincubator/create-react-app/issues/2376
295-
// Pending further investigation:
296-
// https://github.com/mishoo/UglifyJS2/issues/2011
297-
comparisons: false,
298-
},
299-
output: {
300-
comments: false,
301-
// Turned on because emoji and regex is not minified properly using default
302-
// https://github.com/facebookincubator/create-react-app/issues/2488
303-
ascii_only: true,
304-
},
291+
new UglifyJsPlugin({
292+
uglifyOptions: {
293+
compress: {
294+
warnings: false,
295+
// Disabled because of an issue with Uglify breaking seemingly valid code:
296+
// https://github.com/facebookincubator/create-react-app/issues/2376
297+
// Pending further investigation:
298+
// https://github.com/mishoo/UglifyJS2/issues/2011
299+
comparisons: false,
300+
},
301+
output: {
302+
comments: false,
303+
// Turned on because emoji and regex is not minified properly using default
304+
// https://github.com/facebookincubator/create-react-app/issues/2488
305+
ascii_only: true,
306+
},
307+
},
305308
sourceMap: shouldUseSourceMap,
306309
}),
307310
// Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.

packages/react-scripts/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "react-scripts",
2+
"name": "giveth-react-scripts",
33
"version": "1.0.11",
4-
"description": "Configuration and scripts for Create React App.",
4+
"description": "Configuration and scripts for Create React App. Update uglifyjs-webpack-plugin to 1.0.0-beta.2 to utilize uglify-es",
55
"repository": "facebookincubator/create-react-app",
66
"license": "BSD-3-Clause",
77
"engines": {
@@ -56,6 +56,7 @@
5656
"webpack": "3.5.1",
5757
"webpack-dev-server": "2.7.1",
5858
"webpack-manifest-plugin": "1.2.1",
59+
"uglifyjs-webpack-plugin": "^1.0.0-beta.2",
5960
"whatwg-fetch": "2.0.3"
6061
},
6162
"devDependencies": {

0 commit comments

Comments
 (0)