intermediate
esbuild
Use esbuild for very fast transpilation, minification, bundling, and tooling pipelines with known feature trade-offs.
esbuild is a Go-based bundler, transpiler, and minifier optimized for speed. It strips TypeScript types and transforms syntax—it does not perform semantic type checking.
| Capability | Limitation | |------------|------------| | TS/JSX transform | No type errors | | Bundling | Fewer plugin hooks than Webpack | | Minify | Inspect output targets |
esbuild src/index.ts --bundle --platform=browser --outfile=dist/bundle.js
Common placements: Vite dependency pre-bundle, tooling scripts, serverless bundling, and fast local feedback loops paired with `tsc --noEmit` or IDE checks.
On interviews: where esbuild fits in the pipeline, feature gaps versus Babel plugins, and verifying browser targets on output.
Common pitfalls: shipping without typecheck; assuming minified output equals tested behavior; needing custom transforms esbuild cannot express.
The trade-off is speed versus extensibility and semantic guarantees from `tsc`.
Checklist:
- Pair transpile with separate typecheck.
- Use for hot paths needing fast feedback.
- Validate supported syntax for targets.
- Fall back to Babel when plugins are required.