esbuild vs SWC
esbuild vs SWC compared for 2026: esbuild 0.28 (Go bundler, minifier and dev server in one binary) vs SWC 1.16 (Rust compiler used inside other tools, with ES5 output, decorator metadata and Wasm plugins). Includes transpile, bundle and minify timings and output sizes we measured on 3 December 2026.
Quick Answer
esbuild and SWC are the two native-speed JavaScript and TypeScript compilers most build tools sit on, but they are not the same kind of tool. esbuild 0.28.2 (8 August 2026) is a complete bundler: one Go binary that transpiles, bundles, tree-shakes, minifies, watches and serves. SWC (@swc/core 1.16.22, 5 November 2026) is a Rust compiler library with a CLI; its own bundler is slated to be dropped in v2, and its docs point you to SWC-based bundlers such as Rspack, Turbopack and Parcel. In our runs on 3 December 2026, SWC was faster at plain transpiling: 1,001 TypeScript files took 116-142 ms through @swc/core against 724-946 ms through esbuild's build API on one core, and a single 1.3 MB file took 105-126 ms against 163-210 ms. esbuild bundled the whole project in 289-328 ms. SWC produced smaller minified output for lodash and Zod, esbuild minified faster. SWC emitted decorator metadata and ES5 code; esbuild silently skipped emitDecoratorMetadata and refused to lower const, classes and default parameters to ES5. Pick esbuild when you need a bundler; pick SWC as a compiler inside test runners, Rspack or webpack loaders, NestJS or anything that needs decorators metadata or ES5.
Last updated December 3, 2026. Covers esbuild 0.28.2 (8 August 2026, plus unreleased changes on main) and @swc/core 1.16.22 (5 November 2026) with @swc/cli 0.8.2; npm registry metadata and download counts, GitHub repositories and release notes, esbuild README and CHANGELOG, SWC README, CHANGELOG and docs (bundling, compilation, migrating from tsc, plugins) read on 3 December 2026, plus transpile, bundle, minify and TypeScript-semantics runs we did that day.
| Feature | esbuild | SWC |
|---|---|---|
| Licence, Language & Repository | MIT; Go; evanw/esbuild, ~40.2k stars, 727 open issues and PRs | Apache-2.0; Rust; swc-project/swc, ~34.2k stars, 377 open issues and PRs |
| Latest Release | 0.28.2 on 8 Aug 2026 | @swc/core 1.16.22 on 5 Nov 2026 (@swc/cli 0.8.2 on 28 Oct 2026) |
| npm Weekly Downloads (26 Nov-2 Dec 2026) | 345,807,883 | 46,210,622 (@swc/core) |
| Our Run: Install (packages / size) | 2 packages, 11.6 MB | 4 packages, 11.0 MB (+ CLI: 123 packages, 16.6 MB) |
| What It Is | Bundler, minifier, transpiler, dev server | Compiler and minifier library with a CLI |
| Our Run: 1,001 TS Files via JS API (1 core) | 724-946 ms (build with 1,001 entry points, write: false) | 116-142 ms (transformFile x1,001, Promise.all) |
| Our Run: 1,001 TS Files via CLI | 724-984 ms (native binary) | 1,035-1,518 ms (@swc/cli) |
| Our Run: transformSync x1,001 | 1,208-1,476 ms | 115-158 ms |
| Our Run: One 1.3 MB TS File | 163-210 ms | 105-126 ms |
| Our Run: Bundling | Yes: whole project in 289-328 ms (1.37 MB output) | spack deprecated (to be dropped in v2); use an SWC-based bundler |
| Our Run: Minify lodash-es (min / gzip) | 81,328 B / 30,110 B in 22-43 ms | 71,771 B / 24,679 B in 40-52 ms |
| Our Run: Minify Zod (min / gzip) | 460,449 B / 94,623 B in 54-76 ms | 361,341 B / 91,682 B in 110-128 ms |
| Our Run: Target ES5 | Errors: transforming const / class / default arguments to es5 is not supported yet | Compiled and ran (helpers for classes) |
| Our Run: emitDecoratorMetadata | Ignored silently: paramtypes empty | Emitted: paramtypes Db,String |
| Our Run: Type Errors | Emitted, exit 0 (no type checking) | Emitted (no type checking) |
| Our Run: const enum Across Files | Inlined when bundling; left as an import in per-file mode | Left as an import (enum object emitted per file) |
| Plugin Model | JavaScript or Go plugins (onResolve / onLoad) | Rust plugins compiled to Wasm |
| Watch / Dev Server | --watch and --serve built in | swc -w watch; no dev server |
| Node.js Requirement | Node.js >=18 for the npm package | @swc/core: Node.js >=10; @swc/cli: >=20.19.0 |
| Release Activity | 0.27.2-0.28.2 Dec 2025-Aug 2026; fixes on main since | Releases every 1-2 weeks; 1.16.0 Aug 2026 |
esbuild
esbuild is a JavaScript, TypeScript, JSX and CSS bundler and minifier written in Go by Evan Wallace. It ships as one native binary per platform behind a small npm wrapper, with a CLI, a JavaScript API and a Go API. A single call can resolve imports, bundle ESM and CommonJS, tree-shake, split code, minify, write source maps and a metafile, and it includes watch mode and a local HTTP server. Plugins are written in JavaScript or Go against onResolve and onLoad hooks. It transpiles TypeScript by stripping types file by file and never type-checks. Releases are still 0.x: 0.28.0 (2 April 2026) added with { type: 'text' } imports, 0.28.1 (11 June 2026) fixed GHSA-g7r4-m6w7-qqqr, a Windows path traversal in the dev server using backslashes, and 0.28.2 (8 August 2026) fixed a tree-shaking bug with TypeScript import aliases and a CSS minification bug. Unreleased changes on main add es2026 as a tsconfig target, stop publishing to deno.land/x and make merged code-splitting chunks an error. The JavaScript API talks to the Go binary over a child process, which shows up as per-call overhead when you call transform() thousands of times.
Pros
- A complete bundler in one binary: bundled our 1,001-file project in 289-328 ms on one core
- Fast minifier: lodash-es in 22-43 ms and Zod in 54-76 ms, roughly half SWC's time
- Watch mode, dev server, code splitting, metafile and CSS bundling built in
- Plugins in plain JavaScript (onResolve / onLoad), no Rust toolchain needed
- Inlined const enum values across files when bundling (2 /* Blue */)
- Tiny dependency tree: 2 packages, CLI binary starts in about 3 ms
Cons
- Slower than SWC at plain per-file transpiling in our runs: 724-946 ms against 116-142 ms for 1,001 files via the JS API
- Per-call IPC overhead: 1,001 transformSync() calls took 1,208-1,476 ms against 115-158 ms for SWC
- Ignores emitDecoratorMetadata without a warning (design:paramtypes was empty)
- Cannot lower const, let, classes or default parameters to ES5 (5 errors on our file)
- Still 0.x after years; minor versions can carry breaking changes and the last release was August 2026
Best For
Bundling libraries, CLIs, Node.js services and front-end apps, fast production builds without a separate bundler, and tooling that wants one binary with a JavaScript plugin API.
SWC
SWC (Speedy Web Compiler) is a TypeScript and JavaScript compiler written in Rust that works as a Rust library and as an npm package. @swc/core loads a native Node.js addon in process and exposes transform, transformFile, parse, print and minify, in sync and async forms; @swc/cli adds a swc command with directory compilation, --watch, --copy-files and worker threads. Configuration lives in .swcrc: parser syntax, jsc.target down to ES5, loose mode, legacy or 2022-03 decorators, decoratorMetadata, keepClassNames, paths and baseUrl, module output and a minifier with compress and mangle options. Plugins are written in Rust and compiled to Wasm (wasm32-wasip1), tied to compatible swc_core versions. SWC also had a bundler, spack, but its docs say it will be dropped in v2 in favour of SWC-based bundlers such as Parcel 2, Turbopack, Rspack and Farm. Releases are frequent: 1.16.0 (14 August 2026) carried breaking changes to the Rust AST, and 1.16.20, 1.16.21 and 1.16.22 shipped on 22 October, 31 October and 5 November 2026, the last updating Wasmtime and zstd for security advisories. Like esbuild, it strips types without type-checking, file by file, and its migration guide recommends isolatedModules or verbatimModuleSyntax.
Pros
- Fastest transpiler in our runs: 1,001 TS files in 116-142 ms in process, a 1.3 MB file in 105-126 ms
- In-process native addon: 1,001 transformSync() calls in 115-158 ms, ideal for Jest transforms and loaders
- Emitted decorator metadata (design:paramtypes Db,String) with legacyDecorator + decoratorMetadata
- Lowers to ES5: our arrows, classes, const, default parameters and rest destructuring ran after compiling
- Smaller minified output on real libraries: lodash-es 71,771 / 24,679 B and Zod 361,341 / 91,682 B
- Very active: three releases between 22 October and 5 November 2026
Cons
- No supported bundler: spack is deprecated, so you pair SWC with Rspack, webpack, Parcel or similar
- Slower minifier than esbuild (40-52 ms for lodash-es, 110-128 ms for Zod) and larger gzip on our synthetic bundle
- Plugins require Rust and Wasm, and must match swc_core version ranges
- @swc/cli adds 119 packages and needs Node.js 20.19 or later; its start-up was about 60 ms
- Configuration surface is large (.swcrc jsc.* options) and differs from tsconfig in places
Best For
Compiler duty inside other tools: Jest and Vitest-style transforms, webpack or Rspack loaders, NestJS and other decorator-metadata code, ES5 targets, and per-file transpiling at high volume.
A bundler versus a compiler
The headline difference is scope. esbuild is a bundler that happens to transpile: give it an entry point and it resolves imports, bundles ESM and CommonJS, tree-shakes, minifies, splits chunks and writes source maps, and the same binary watches files and serves them over HTTP. SWC is a compiler that other tools embed: @swc/core turns one file into another, minifies, parses and prints, and the CLI compiles directories. SWC did ship a bundler, spack, but its documentation now carries a notice that it will be dropped in v2 and recommends SWC-based bundlers such as Parcel 2, Turbopack, Rspack and Farm instead. That shapes how you adopt each one. You can build a whole library or service with esbuild alone. With SWC you normally pick a host first: a bundler with an SWC loader, a test runner transform, or a framework that already uses it internally. On our 1,001-file synthetic TypeScript project, esbuild produced a single 1.37 MB bundle in 289-328 ms on one core; with SWC we could only compile the files one to one. If the comparison you actually face is which bundler to use, see our Vite vs Webpack, Rspack vs Vite and tsup vs tsdown comparisons, all of which sit on one of these two engines or their successors.
What we measured: transpiling 1,001 TypeScript files
On 3 December 2026 we generated 1,001 TypeScript files (22,494 lines, 4.0 MB) with interfaces, enums, generic classes, parameter properties, async generators and satisfies, and compiled them with esbuild 0.28.2 and @swc/core 1.16.22 on Node.js 22.23.5 in a 2-vCPU sandbox. Through the JavaScript APIs on one core, SWC's transformFile over all files with Promise.all took 116-142 ms; esbuild's build() with 1,001 entry points and write: false took 724-946 ms. With both cores, 81-91 ms against 451-956 ms. Calling transformSync() once per file took 115-158 ms with SWC and 1,208-1,476 ms with esbuild, because esbuild's JavaScript API sends every call to its Go process while SWC runs in process. On a single concatenated 1.3 MB file the gap narrowed to 105-126 ms against 163-210 ms. From the command line, esbuild's native binary compiled the directory in 724-984 ms and @swc/cli in 1,035-1,518 ms; the CLI loads Node.js and worker threads first (about 60 ms just for --version, against about 3 ms for esbuild's binary). These are synthetic files on one machine, but the pattern is consistent: SWC wins at many small transforms inside a Node.js process, esbuild wins when you hand it the whole job.
Minification and output size
We minified three inputs with esbuild's transformSync({ minify: true }) and SWC's minifySync({ compress: true, mangle: true, module: true }), five runs on one core. The full lodash-es export bundle (244,424 B) came out at 81,328 B (30,110 B gzipped) from esbuild in 22-43 ms and 71,771 B (24,679 B gzipped) from SWC in 40-52 ms. A bundle of everything Zod 4.6.7 exports (759,312 B) came out at 460,449 B (94,623 B) from esbuild in 54-76 ms and 361,341 B (91,682 B) from SWC in 110-128 ms. On our synthetic 1.37 MB project bundle, SWC's raw output was slightly smaller (766,651 B against 779,313 B) but compressed worse (91,553 B against 81,247 B gzipped), and took 229-327 ms against 178-203 ms. So SWC's compressor did more work and usually saved bytes on real library code, at roughly twice the time; esbuild is the faster option with competitive output. Measure on your own bundle: gzip and brotli sizes are what users download, and they did not always follow raw size. If you already bundle with esbuild, its minifier is effectively free; if you bundle with Rspack or webpack, SWC is the usual minifier there.
TypeScript semantics: decorators, ES5, enums and type errors
Both tools strip types without checking them: a file assigning a string to a number compiled and exited 0 with each. Neither sees across files during a per-file transform, which is why SWC's tsc migration guide recommends isolatedModules or verbatimModuleSyntax. Differences appeared in older TypeScript features. With experimentalDecorators and emitDecoratorMetadata in tsconfig, an esbuild bundle of a decorated service produced no design:paramtypes metadata and no warning; SWC with legacyDecorator and decoratorMetadata produced Db,String, which is what dependency-injection frameworks such as NestJS read. Targeting ES5, esbuild stopped with errors such as Transforming class syntax to the configured target environment ("es5") is not supported yet, for const, classes, default parameters and object literal extensions; SWC compiled the same file to ES5 with helper functions, and it ran. A const enum imported from another file was inlined by esbuild when bundling (2 /* Blue */) and left as a normal import by esbuild's per-file transform and by SWC, both of which emit the enum as an object, so the code still works. If your code base uses decorator metadata or must support ES5, that alone decides it for SWC.
Limits, plugins and maintenance
Plugin models differ sharply. esbuild plugins are JavaScript (or Go) functions hooked into resolve and load, easy to write for virtual modules, aliases or loading custom file types, but the hooks work on whole files and paths (onStart, onResolve, onLoad, onEnd), not on esbuild's syntax tree. SWC plugins can transform the AST, but you write them in Rust, compile them to Wasm and keep them in step with compatible swc_core versions. Installation is light for both: esbuild is 2 packages and 11.6 MB, @swc/core 4 packages and 11.0 MB, while @swc/cli brings 123 packages and requires Node.js 20.19. Maintenance looks different too. esbuild is still on 0.x; its last release was 0.28.2 on 8 August 2026, with fixes queued on main, and 0.28.1 patched a dev-server path traversal on Windows. SWC ships every week or two, 1.16.22 on 5 November 2026 being the latest, and 1.16.0 broke the Rust AST for plugin authors. Neither replaces tsc for type-checking or declaration files, so keep tsc --noEmit in CI and use tsc, tsdown or a dts plugin for .d.ts output. For running TypeScript directly in development, see tsx vs ts-node.
Verdict
Pick esbuild when you need a bundler. It bundled, tree-shook and minified our project in one call, minified real libraries about twice as fast as SWC, and gives you watch mode, a dev server and JavaScript plugins without any other tool. That covers most libraries, CLIs, Node.js services and simple front-end apps. Pick SWC when you need a compiler rather than a bundler: as the transform in a test runner, a loader in Rspack or webpack, a per-file build step that runs thousands of times, or code that depends on emitDecoratorMetadata (NestJS, TypeORM, InversifyJS) or must run as ES5. In our runs it was several times faster at per-file transpiling and produced smaller minified lodash and Zod. Many projects use both: esbuild for bundling, SWC wherever decorators or a test transform need it. Either way, keep tsc --noEmit in CI, because neither tool type-checks, and turn on isolatedModules or verbatimModuleSyntax.


