esbuild

0.28.0 · active · verified Sat Apr 18

esbuild is an extremely fast JavaScript and CSS bundler and minifier. The current stable version is v0.28.0. The project maintains an active release schedule, frequently delivering patch updates and minor versions (e.g., v0.27.x, v0.28.x) within short periods, sometimes multiple per month, indicating rapid development and responsiveness to issues.

Common errors

Warnings

Install

Imports

Quickstart

Bundles a TypeScript file `src/index.ts` into `dist/bundle.js` for a Node.js environment, targeting ES2022.

import { build } from 'esbuild';

const entryPoint = 'src/index.ts';
const outFile = 'dist/bundle.js';

await build({
  entryPoints: [entryPoint],
  bundle: true,
  outfile: outFile,
  platform: 'node',
  target: 'es2022'
}).then(() => {
  console.log(`Successfully bundled ${entryPoint} to ${outFile}`);
}).catch(() => {
  process.exit(1);
});

view raw JSON →