Lesson 28 / 31

Modern Alternatives: esbuild, Oxc & Native TypeScript

Compare Babel and SWC with esbuild, Oxc and Node's built-in type stripping, and choose the lightest tool that fits.

More fast options

esbuild (Go) transpiles JSX and TypeScript very quickly and powers many bundlers. Oxc and Rolldown (Rust) are newer tools that Vite is adopting. None of them type-check, and they do not replicate every Babel plugin.

Run TypeScript without a build step

Recent Node.js versions can strip simple TypeScript types natively, so small scripts need no transpiler at all.

# Node.js 22.18+ / 24 can run .ts files that use erasable syntax only
node script.ts

# esbuild: transpile and bundle quickly
npx esbuild src/index.ts --bundle --outfile=dist/index.js --target=es2022

Pick the lightest tool that meets your targets. Keep Babel only when you rely on specific plugins, and always run tsc --noEmit for type safety.