LinuxCommandLibrary

esbuild

Extremely fast JavaScript and TypeScript bundler

TLDR

Bundle JavaScript file

$ esbuild [app.js] --bundle --outfile=[out.js]
copy
Bundle with minification
$ esbuild [app.js] --bundle --minify --outfile=[out.js]
copy
Bundle TypeScript
$ esbuild [app.ts] --bundle --outfile=[out.js]
copy
Watch mode
$ esbuild [app.js] --bundle --watch --outfile=[out.js]
copy
Start dev server
$ esbuild [app.js] --bundle --serve=[8000]
copy
Bundle for browser
$ esbuild [app.js] --bundle --platform=browser --outfile=[out.js]
copy
Generate source maps
$ esbuild [app.js] --bundle --sourcemap --outfile=[out.js]
copy

SYNOPSIS

esbuild [options] [entrypoints_...]

DESCRIPTION

esbuild is an extremely fast JavaScript and TypeScript bundler and minifier. Written in Go, it's 10-100x faster than traditional bundlers like webpack or Parcel.
The tool handles bundling, minification, code splitting, tree shaking, and transpilation. It supports JSX, TypeScript, and modern JavaScript features without configuration.
esbuild's speed makes it ideal for development builds and as a lower-level tool in build pipelines.

PARAMETERS

ENTRYPOINTS_

Input files to process.
--bundle
Bundle dependencies.
--outfile FILE
Output file path.
--minify
Minify output.
--watch
Rebuild on changes.
--serve [PORT]
Start development server.
--platform PLATFORM
Target: browser, node, neutral.
--sourcemap
Generate source maps.
--target VERSION
JavaScript target version.
--help
Display help information.

CAVEATS

Plugin ecosystem smaller than webpack. Some transformations not supported. Configuration differs from other bundlers. May need plugins for complex setups.

HISTORY

esbuild was created by Evan Wallace (co-founder of Figma) and released in 2020. Its dramatic speed improvement over existing tools came from being written in Go with parallelization.

SEE ALSO

webpack(1), rollup(1), vite(1), swc(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community