|
13 | 13 | const autoprefixer = require('autoprefixer');
|
14 | 14 | const path = require('path');
|
15 | 15 | const webpack = require('webpack');
|
| 16 | +const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); |
16 | 17 | const HtmlWebpackPlugin = require('html-webpack-plugin');
|
17 | 18 | const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
18 | 19 | const ManifestPlugin = require('webpack-manifest-plugin');
|
@@ -287,21 +288,23 @@ module.exports = {
|
287 | 288 | // Otherwise React will be compiled in the very slow development mode.
|
288 | 289 | new webpack.DefinePlugin(env.stringified),
|
289 | 290 | // 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 | + }, |
305 | 308 | sourceMap: shouldUseSourceMap,
|
306 | 309 | }),
|
307 | 310 | // Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.
|
|
0 commit comments