esbuild
esbuild is an extremely fast JavaScript and TypeScript bundler and minifier written in Go that is 10-100x faster than traditional JavaScript-based build tools. …
Installation
npm install -D esbuild
yarn add -D esbuild
pnpm add -D esbuild
Import
import * as esbuild from 'esbuild';
Quick Example
import * as esbuild from 'esbuild';
await esbuild.build({
entryPoints: ['src/index.ts'],
bundle: true,
outfile: 'dist/out.js',
minify: true,
sourcemap: true,
});About esbuild
esbuild is an extremely fast JavaScript and TypeScript bundler and minifier written in Go that is 10-100x faster than traditional JavaScript-based build tools. esbuild achieves this speed by being written in a compiled language (Go) and making heavy use of parallelism across all available CPU cores. The tool supports bundling JavaScript, TypeScript, JSX, TSX, CSS, JSON, and text files, with tree shaking, source maps, minification, and code splitting built in. esbuild can produce output in ESM, CommonJS, and IIFE formats, and handles node_modules resolution, path aliases, and define-based constant replacement. While esbuild is incredibly fast for compilation and bundling, it intentionally omits some features that tools like Webpack provide, such as HTML generation, advanced code splitting strategies, and certain PostCSS-like CSS transformations. esbuild serves as the foundation for Vite's development server transformation pipeline and is used by many other tools (tsup, tsx, Remix) as their underlying TypeScript compiler. The tool also provides a powerful plugin API for custom file type handling and build pipeline extensions.
Quick Facts
| Package | esbuild |
| Category | Build Tool |
| Weekly Downloads | 15M+ |
| License | MIT |
| Install | npm install -D esbuild |
Related Packages
SWC (Speedy Web Compiler) is a Rust-based JavaScript/TypeScript compiler that provides a drop-in rep…
Vite is a next-generation frontend build tool created by Evan You (creator of Vue.js) that provides …
Rollup is a JavaScript module bundler that compiles small pieces of code into larger, more complex b…
tsup is a zero-config TypeScript bundler powered by esbuild, designed specifically for building Type…
Webpack is a powerful and highly configurable static module bundler for modern JavaScript applicatio…
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.