Notice: recommend to use terser-webpack-plugin, support uglify, esbuild, and swc. doc.
Minify bundle with swc in webpack
$ npm i --save-dev @swc/core swc-webpack-plugin webpack
const { SWCMinifyPlugin } = require('swc-webpack-plugin');
module.exports = {
...,
optimization: {
minimize: true,
minimizer: [new SWCMinifyPlugin()],
},
};
Supports all swc configuration
Type: boolean
Run in sync mode