blendid
blendid copied to clipboard
Using Uglify-ES instead of Uglify...
Hello!
I've configured my babel-loader so that it outputs ES6 code (and not transpiled ES5). Can you please advise how I can replace uglify with uglify-es to process the built javascript/s?
Thanks!
I am not sure how to configure blendid to use uglify-es
however, the following is the change that can be made within blendid webpack-multi-config.js
: Replace webpack.optimize.UglifyJsPlugin
with UglifyJsPlugin
(since it now uses uglify-es internally)
Original
webpackConfig.plugins.push(
new webpack.DefinePlugin(TASK_CONFIG.javascripts.production.definePlugin),
new webpack.optimize.UglifyJsPlugin(uglifyConfig),
new webpack.NoEmitOnErrorsPlugin()
)
Changes
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
...
webpackConfig.plugins.push(
new webpack.DefinePlugin(TASK_CONFIG.javascripts.production.definePlugin),
new UglifyJsPlugin(uglifyConfig),
new webpack.NoEmitOnErrorsPlugin()
)