# esbuild — Extremely Fast JavaScript Bundler > esbuild is an extremely fast JavaScript/TypeScript bundler written in Go. 10-100x faster than webpack/Rollup. Powers Vite, Bun, and many modern build tools as their underlying transform engine. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: ## Quick Use ```bash npm i -D esbuild ``` CLI: ```bash npx esbuild src/app.ts --bundle --outfile=dist/app.js \ --platform=browser --target=es2020 --minify ``` JS API: ```js import { build } from "esbuild"; await build({ entryPoints: ["src/app.ts"], bundle: true, outfile: "dist/app.js", platform: "browser", target: "es2020", minify: true, sourcemap: true, }); ``` ## Intro esbuild is an extremely fast JavaScript/TypeScript bundler written in Go by Evan Wallace (Figma co-founder). Benchmark: bundles the three.js codebase (10K modules) in ~0.3s — compared to ~35s for webpack. Powers Vite, Bun, Snowpack, and many tools as their transform engine. - **Repo**: https://github.com/evanw/esbuild - **Stars**: 39K+ - **Language**: Go - **License**: MIT ## What esbuild Does - **Bundling** — merge modules into one file - **TypeScript** — strip types (no type check) - **JSX** — transform JSX to JS - **Minification** — tree-shake + compress - **Tree shaking** — remove unused exports - **Source maps** — for debugging - **Plugin API** — custom loaders and resolvers - **Splitting** — code splitting for dynamic imports - **Watch mode** — incremental rebuilds ## Architecture Written in Go for parallelism (Go is 10x faster than JS for this kind of work + perfect concurrency). Parses, transforms, and prints all in one pass without intermediate AST serialization. No babel, no multiple plugins stacking up overhead. ## Self-Hosting Bundled as a binary via npm. Ships in your build pipeline. ## Key Features - 10-100x faster than webpack/Rollup - TypeScript + JSX out of the box - Tree shaking - Minification - Source maps - CSS bundling (basic) - Plugin API - Incremental watch mode - WASM build available ## Comparison | Tool | Speed | Features | Plugins | |---|---|---|---| | esbuild | Fastest | Minimal | Limited | | Rollup | Medium | Mature | Huge ecosystem | | webpack | Slow | Most features | Huge ecosystem | | Rolldown | Very fast | WIP | Rollup-compatible | | Rspack | Very fast | webpack-compatible | webpack ecosystem | ## FAQ **Q: Why is it so fast?** A: Written in Go (native parallelism) + no intermediate AST + single-pass parse/transform/print + minimal plugin API. Evan wrote a detailed architecture doc. **Q: Is it production-ready?** A: Yes. Figma, Vite, and Bun all use it in production. It doesn't do type-checking, so pair it with a separate `tsc --noEmit` run. **Q: What's its relationship with Vite?** A: In dev mode Vite uses esbuild for dependency pre-bundling; for production it uses Rollup (because its plugin ecosystem is more mature). ## Sources & Credits - Docs: https://esbuild.github.io - GitHub: https://github.com/evanw/esbuild - License: MIT --- Source: https://tokrepo.com/en/workflows/esbuild-extremely-fast-javascript-bundler-ee954487 Author: AI Open Source