How to minify ES6 code using Webpack?

Not sure if you’re still looking for an answer to this, but now you can include the beta version of uglifyjs-webpack-plugin as a webpack plugin and it’ll use uglify-es which can minify ES6 code.

npm install uglifyjs-webpack-plugin

and then in your webpack.config.js:

const Uglify = require("uglifyjs-webpack-plugin");

module.exports = {
    entry: ...,
    output: ...,
    plugins: [
        new Uglify()
    ]
};

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)