Open amoshydra opened 6 years ago
Alternatively, should it provide user a way to use their own uglify plugin?
webpackConfig.plugins.push(
new webpack.DefinePlugin(TASK_CONFIG.javascripts.production.definePlugin),
(webpackConfig.uglifyPlugin) // Allow the use of other uglifier
? new webpackConfig.uglifyPlugin(uglifyConfig)
: new webpack.optimize.UglifyJsPlugin(uglifyConfig),
new webpack.NoEmitOnErrorsPlugin()
)
Note:
This is a potential breaking change since UglifyJsPlugin
require minifyOptions to be defined inside the uglifyOptions
object. Ref: https://github.com/webpack-contrib/uglifyjs-webpack-plugin#uglifyoptions
uglifyConfig = {
compress: false,
mangle: false,
beautify: true,
comments: true,
sourceMap: true,
}
uglifyConfig = {
uglifyOptions: {
compress: false,
mangle: false,
output: {
beautify: true,
comments: true,
},
},
sourceMap: true,
}
This change will automatically allow webpack to minify ES6 code.
Related to https://github.com/vigetlabs/blendid/issues/505