Use esbuild as minifier for webpack.
$ yarn add esbuild-webpack-plugin --dev
const ESBuildPlugin = require('esbuild-webpack-plugin').default;
module.exports = {
optimization: {
minimizer: [
new ESBuildPlugin(),
/**
* Or customize ESBuild options like below:
*
* new ESBuildPlugin({target: "es5"}),
*
* For details, please refer: https://github.com/evanw/esbuild
*/
],
},
};
# Get prepared
$ yarn && yarn build
# Minify with terser
$ yarn build:example
# Minify with esbuild
$ yarn build:example:esbuild
# Do not minify
$ yarn build:example:nocompress
MIT