blendid icon indicating copy to clipboard operation
blendid copied to clipboard

Using Uglify-ES instead of Uglify...

Open macouella opened this issue 7 years ago • 1 comments

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!

macouella avatar Oct 26 '17 12:10 macouella

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()
    )

amoshydra avatar Feb 27 '18 03:02 amoshydra