Build Tools (esbuild, swc, tsc)
Four TypeScript compilers ship in 2026 — pick by the trade-off between speed, completeness, and what you actually need.
The choices
| Tool | Language | Strengths | Limits |
|---|---|---|---|
| tsc | TypeScript | Official, complete, type-checks. | Slowest on big projects. |
| esbuild | Go | Lightning fast. | Doesn't type-check; some edge cases. |
| swc | Rust | Fast, powers Next.js + Vitest. | Doesn't type-check. |
| Vite | esbuild + Rollup | Best dev DX for apps. | App-shaped projects. |
The split
The modern pattern is to separate compile from type-check:
- Use esbuild / swc / Vite for fast development & production builds.
- Use
tsc --noEmitin CI for type checking. - Use
tscfor emitting.d.tsfiles in libraries (esbuild/swc don't do this perfectly).
tsc — official
SHELL
tsc # builds based on tsconfig.json tsc -p tsconfig.build.json tsc --noEmit # type-check only tsc -w # watch mode tsc -b # build mode for project references
esbuild
SHELL
pnpm add -D esbuild esbuild src/index.ts --bundle --platform=node --outfile=dist/index.js
swc
SHELL
pnpm add -D @swc/cli @swc/core swc src -d dist
Vite (apps)
SHELL
npm create vite@latest my-app -- --template react-ts cd my-app npm install npm run dev # dev server npm run build # production build
For libraries — tsup
tsup wraps esbuild + tsc to produce ESM + CJS + .d.ts in one command:
SHELL
pnpm add -D tsup tsup src/index.ts --format esm,cjs --dts
Tip: Don't worry about picking the "fastest" tool until you measure. A clean monorepo with
tsc -b can be plenty fast; a sloppy esbuild config still won't catch bugs.Example
Example
// 'tsc' — official, strict, slow for big projects
// 'esbuild' — Go-based bundler, lightning fast
// 'swc' — Rust-based; powers Next.js & Vitest
// 'Vite' — esbuild for dev + Rollup for prod
//
// All of them transpile TS without type-checking — keep 'tsc --noEmit' in CI.
console.log('Compile fast at dev time, type-check separately');
Try it Yourself »
Exercise
Rust-based TS transpiler used by Next.js and Vitest.
Three letters.
Discussion
Loading…