explaingit

evanw/esbuild

39,904GoAudience · developerComplexity · 2/5MaintainedLicenseSetup · easy

TLDR

A blazingly fast JavaScript bundler written in Go that turns multiple source files into optimized browser bundles in milliseconds instead of seconds.

Mindmap

mindmap
  root((esbuild))
    What it does
      Bundles JavaScript
      Minifies code
      Handles TypeScript
    Key features
      Tree shaking
      Source maps
      Watch mode
      Dev server
    Supported formats
      ESM modules
      CommonJS
      JSX and CSS
    Why it's fast
      Written in Go
      Multi-core CPU
      No JS overhead
    Use cases
      Library publishing
      Web apps
      Tool foundation
    APIs available
      Command line
      JavaScript package
      Go library

Things people build with this

USE CASE 1

Bundle and minify a React or Vue web application for production deployment in milliseconds.

USE CASE 2

Publish a TypeScript library to npm with automatic tree-shaking and source maps included.

USE CASE 3

Use as the underlying bundler in a framework or build tool that adds higher-level features on top.

USE CASE 4

Set up a local development server with watch mode to rebuild instantly as you edit files.

Tech stack

GoJavaScriptTypeScriptJSXCSS

Getting it running

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

esbuild is a JavaScript bundler and minifier that is dramatically faster than the tools that preceded it. The problem it solves is that build steps in JavaScript projects, turning many source files into a single optimized bundle for the browser, had become painfully slow. Tools like webpack and Parcel, while feature-rich, can take seconds or even minutes to complete a build on large projects. esbuild does the same job in milliseconds. The speed comes from writing esbuild in Go rather than JavaScript, which allows it to take full advantage of multiple CPU cores and avoids the overhead of running in a JavaScript runtime. esbuild natively handles JavaScript, TypeScript, JSX, and CSS, so most projects need no plugins for basic bundling. It supports both ESM and CommonJS module formats, does tree shaking to remove unused code, can minify output to reduce file size, generates source maps for debugging, includes a local development server, and has a watch mode that rebuilds when files change. A straightforward API is available via the command line, as a JavaScript package, and as a Go library. You would use esbuild when you want fast builds in a JavaScript or TypeScript project, whether for a library you're publishing, a web application you're deploying, or as the underlying bundler powering another tool. Many popular frameworks and tools use esbuild internally for its speed while adding their own higher-level features on top. The tech stack is Go for the core bundler, with thin JavaScript and Go API wrappers that let you call it from either language.

Copy-paste prompts

Prompt 1
Show me how to set up esbuild to bundle a TypeScript project with source maps and minification for production.
Prompt 2
How do I use esbuild's watch mode and dev server to develop a React app with hot reloading?
Prompt 3
What's the simplest way to use esbuild from the command line to bundle multiple entry points?
Prompt 4
How can I configure esbuild to handle CSS imports and JSX in my JavaScript files?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.