File tree Expand file tree Collapse file tree 1 file changed +22
-7
lines changed Expand file tree Collapse file tree 1 file changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -683,24 +683,39 @@ module.exports = {
683683With built-in minify functions:
684684
685685``` ts
686- import type { SwcMinifyFunction } from " terser-webpack-plugin" ;
686+ import type { JsMinifyOptions as SwcOptions } from " @swc/core" ;
687+ import type { MinifyOptions as UglifyJSOptions } from " uglify-js" ;
688+ import type { TransformOptions as EsbuildOptions } from " esbuild" ;
689+ import type { MinifyOptions as TerserOptions } from " terser" ;
687690
688691module .exports = {
689692 optimization: {
690693 minimize: true ,
691694 minimizer: [
692- new TerserPlugin <SwcMinimizer >({
695+ new TerserPlugin <SwcOptions >({
693696 minify: TerserPlugin .swcMinify ,
694697 terserOptions: {
695- compress: true ,
698+ // `swc` options
699+ },
700+ }),
701+ new TerserPlugin <UglifyJSOptions >({
702+ minify: TerserPlugin .uglifyJsMinify ,
703+ terserOptions: {
704+ // `uglif-js` options
705+ },
706+ }),
707+ new TerserPlugin <EsbuildOptions >({
708+ minify: TerserPlugin .esbuildMinify ,
709+ terserOptions: {
710+ // `esbuild` options
696711 },
697712 }),
698713
699- // Alternative:
700- new TerserPlugin <typeof TerserPlugin . swcMinify >({
701- minify: TerserPlugin .swcMinify ,
714+ // Alternative usage :
715+ new TerserPlugin <TerserOptions >({
716+ minify: TerserPlugin .terserMinify ,
702717 terserOptions: {
703- compress: true ,
718+ // `terser` options
704719 },
705720 }),
706721 ],
You can’t perform that action at this time.
0 commit comments