esbuild-plugin-swc-minify
v2.0.1
Published
esbuild plugin to minify JS(X) files using SWC
Downloads
27
Readme
esbuild-plugin-swc-minify
esbuild plugin to minify js(x) files using SWC
Install
// if using npm 🤷🏽♂️
npm i -D esbuild-plugin-swc-minify
// if using pnpm 😎
pnpm add -D esbuild-plugin-swc-minify
Usage example
import * as esbuild from 'esbuild';
import { swcMinify } from 'esbuild-plugin-swc-minify';
esbuild.build({
entryPoints: [ './index.js' ],
outfile: 'dist/index.min.js',
bundle: true,
minify: true,
sourceMap: true,
plugins: [ swcMinify({ ecma: 2022 }) ]
});
Options
When instantiating plugin you can pass an objects with options. This object has SWC official JsMinifyOptions
type, see the 'Type Declarations' in JsMinifyOptions。