An ESBuild plugin that integrates the SWC compiler for fast JavaScript/TypeScript transformation and bundling. Version 0.0.3 requires Node >=16.0.0 and peer dependencies @swc/core and esbuild. It claims faster performance than the alternative 'esbuild-plugin-swc' and supports SWC's env mode 'usage' for automatic polyfilling based on browser targets. It ships TypeScript types and uses named exports.
npm install esbuild-plugin-swc2No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Example configuration of esbuild with swc plugin for TypeScript/React using browserslist for auto-polyfill.
Set module: { type: 'es6' } in SWC options if using ESBuild's default format.Use esbuild without incremental mode, or toggle incremental off.
Specify jsc.target to match your target browsers (e.g., 'es2015', 'es2020').
Provide a valid browserslist string or array in env.targets.
Consider using unique package name or verify you have the correct one.
npm install @swc/core
import { pluginSwc } from 'esbuild-plugin-swc2'Check SWC jsc.parser.syntax and ensure all required SWC plugins are installed.