Cette page est affichée en anglais. Une traduction française est en cours.
SkillsApr 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.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
step-1.md
Commande d'installation directe
npx -y tokrepo@latest install ee954487-3577-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

TL;DR
esbuild bundles JavaScript and TypeScript 10-100x faster than webpack by leveraging Go parallelism.
§01

What it is

esbuild is an extremely fast JavaScript and TypeScript bundler written in Go by Evan Wallace (Figma co-founder). It bundles, minifies, tree-shakes, and generates source maps for modern web projects at speeds that are 10-100x faster than traditional JavaScript-based bundlers.

The tool serves frontend developers, library authors, and build-tool maintainers. It powers Vite, Bun, and other modern tools as their underlying transform engine.

§02

How it saves time or tokens

esbuild transforms the three.js codebase (10,000+ modules) in approximately 0.3 seconds compared to 35 seconds for webpack. This speed comes from Go's native parallelism, shared memory, and zero-copy parsing. Faster builds mean shorter feedback loops during development and faster CI pipelines.

§03

How to use

  1. Install esbuild with npm i -D esbuild.
  2. Run the CLI to bundle your entry point: npx esbuild src/app.ts --bundle --outfile=dist/app.js.
  3. Add flags for your target environment: --platform=browser --target=es2020 --minify --sourcemap.
§04

Example

import { build } from 'esbuild';

await build({
  entryPoints: ['src/app.ts'],
  bundle: true,
  outfile: 'dist/app.js',
  platform: 'browser',
  target: 'es2020',
  minify: true,
  sourcemap: true,
});
§05

Related on TokRepo

§06

Common pitfalls

  • esbuild strips TypeScript types but does not run type checking. Pair it with tsc --noEmit in your CI pipeline for type safety.
  • The plugin API is powerful but limited compared to webpack's loader ecosystem. Check plugin compatibility before migrating complex setups.
  • Code splitting with esbuild requires format: 'esm'. CommonJS output does not support dynamic import() splitting.

Questions fréquentes

Why is esbuild so much faster than webpack?+

esbuild is written in Go, which compiles to native code with true parallelism via goroutines. It parses, links, and generates code in parallel across CPU cores. JavaScript bundlers like webpack run single-threaded in Node.js and pay overhead for garbage collection and dynamic typing.

Can esbuild replace webpack entirely?+

For many projects, yes. esbuild handles bundling, minification, TypeScript, JSX, and tree shaking. However, projects relying on webpack-specific loaders (e.g., CSS modules with postcss-loader) or HMR may need Vite (which uses esbuild under the hood) as a bridge.

Does esbuild support hot module replacement?+

esbuild has a watch mode and a built-in dev server with live reload, but it does not support hot module replacement (HMR) at the component level. Vite adds HMR on top of esbuild transforms.

What is esbuild's relationship with Vite?+

Vite uses esbuild for dependency pre-bundling and TypeScript/JSX transforms during development. For production builds, Vite uses Rollup by default but can be configured to use esbuild for the final bundle as well.

Is esbuild production-ready?+

Yes. esbuild has been stable since 2020 and is used in production by Vite, Bun, Snowpack, and thousands of projects. It follows semver and maintains backward compatibility across releases.

Sources citées (3)

Fil de discussion

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

Actifs similaires