Cette page est affichée en anglais. Une traduction française est en cours.
ConfigsApr 11, 2026·2 min de lecture

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.

Introduction

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.

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

Discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires