🔧
Build Tool15M+/wkMIT

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
npm install -D esbuild
yarn
yarn add -D esbuild
pnpm
pnpm add -D esbuild

Import

ESM
import * as esbuild from 'esbuild';

Quick Example

usage
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

Packageesbuild
CategoryBuild Tool
Weekly Downloads15M+
LicenseMIT
Installnpm install -D esbuild

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.