diff --git a/webpack.config.js b/webpack.config.js index f3ab8618e4182..2139dd76db422 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -83,8 +83,8 @@ const webpackConfig = { output: { path: path.join( __dirname, 'public' ), publicPath: '/calypso/', - filename: '[name].[chunkhash].opt.js', // prefer the chunkhash, which depends on the chunk, not the entire build - chunkFilename: '[name].[chunkhash].opt.js', // ditto + filename: '[name].[chunkhash].min.js', // prefer the chunkhash, which depends on the chunk, not the entire build + chunkFilename: '[name].[chunkhash].min.js', // ditto devtoolModuleFilenameTemplate: 'app:///[resource-path]', }, optimization: { @@ -112,6 +112,9 @@ const webpackConfig = { */ collapse_vars: false, }, + mangle: { + safari10: true, + }, ecma: 5, }, } ), @@ -254,25 +257,4 @@ if ( ! config.isEnabled( 'desktop' ) ) { ); } -if ( shouldMinify ) { - webpackConfig.plugins.push( - new UglifyJsPlugin( { - cache: 'docker' !== process.env.CONTAINER, - parallel: true, - sourceMap: Boolean( process.env.SOURCEMAP ), - uglifyOptions: { - compress: { - /** - * Produces inconsistent results - * Enable when the following is resolved: - * https://github.com/mishoo/UglifyJS2/issues/3010 - */ - collapse_vars: false, - }, - ecma: 5, - }, - } ) - ); -} - module.exports = webpackConfig;