esbuild-plugin-swc-minify

2.0.1 • Public • Published

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

Package Sidebar

Install

npm i esbuild-plugin-swc-minify

Weekly Downloads

6

Version

2.0.1

License

ISC

Unpacked Size

5.28 kB

Total Files

7

Last publish

Collaborators

  • d1g1tal