OS Manuals

/usr/bin/esbuild

An extremely fast bundler for the web

From esbuild 0.28.2-r9 (os), captured 2026-11-05 by running esbuild --help (exit 0). permalink

Also provided by 1 other package version
Usage:
  esbuild [options] [entry points]

Documentation:
  https://esbuild.github.io/

Repository:
  https://github.com/evanw/esbuild

Simple options:
  --bundle              Bundle all dependencies into the output files
  --define:K=V          Substitute K with V while parsing
  --external:M          Exclude module M from the bundle (can use * wildcards)
  --format=...          Output format (iife | cjs | esm, no default when not
                        bundling, otherwise default is iife when platform
                        is browser and cjs when platform is node)
  --loader:X=L          Use loader L to load file extension X, where L is
                        one of: base64 | binary | copy | css | dataurl |
                        empty | file | global-css | js | json | jsx |
                        local-css | text | ts | tsx
  --minify              Minify the output (sets all --minify-* flags)
  --outdir=...          The output directory (for multiple entry points)
  --outfile=...         The output file (for one entry point)
  --packages=...        Set to "external" to avoid bundling any package
  --platform=...        Platform target (browser | node | neutral,
                        default browser)
  --serve=...           Start a local HTTP server on this host:port for outputs
  --sourcemap           Emit a source map
  --splitting           Enable code splitting (currently only for esm)
  --target=...          Environment target (e.g. es2017, chrome58, firefox57,
                        safari11, edge16, node10, ie9, opera45, default esnext)
  --watch               Watch mode: rebuild on file system changes (stops when
                        stdin is closed, use "--watch=forever" to ignore stdin)

Advanced options:
  --abs-paths=...           Emit absolute instead of relative paths in these
                            situations (code | log | metafile)
  --allow-overwrite         Allow output files to overwrite input files
  --analyze                 Print a report about the contents of the bundle
                            (use "--analyze=verbose" for a detailed report)
  --asset-names=...         Path template to use for "file" loader files
                            (default "[name]-[hash]")
  --banner:T=...            Text to be prepended to each output file of type T
                            where T is one of: css | js
  --certfile=...            Certificate for serving HTTPS (see also "--keyfile")
  --charset=utf8            Do not escape UTF-8 code points
  --chunk-names=...         Path template to use for code splitting chunks
                            (default "[name]-[hash]")
  --color=...               Force use of color terminal escapes (true | false)
  --cors-origin=...         Allow cross-origin requests from this origin
  --drop:...                Remove certain constructs (console | debugger)
  --drop-labels=...         Remove labeled statements with these label names
  --entry-names=...         Path template to use for entry point output paths
                            (default "[dir]/[name]", can also use "[hash]")
  --footer:T=...            Text to be appended to each output file of type T
                            where T is one of: css | js
  --global-name=...         The name of the global for the IIFE format
  --ignore-annotations      Enable this to work with packages that have
                            incorrect tree-shaking annotations
  --inject:F                Import the file F into all input files and
                            automatically replace matching globals with imports
  --jsx-dev                 Use React's automatic runtime in development mode
  --jsx-factory=...         What to use for JSX instead of React.createElement
  --jsx-fragment=...        What to use for JSX instead of React.Fragment
  --jsx-import-source=...   Override the package name for the automatic runtime
                            (default "react")
  --jsx-side-effects        Do not remove unused JSX expressions
  --jsx=...                 Set to "automatic" to use React's automatic runtime
                            or to "preserve" to disable transforming JSX to JS
  --keep-names              Preserve "name" on functions and classes
  --keyfile=...             Key for serving HTTPS (see also "--certfile")
  --legal-comments=...      Where to place legal comments (none | inline |
                            eof | linked | external, default eof when bundling
                            and inline otherwise)
  --line-limit=...          Lines longer than this will be wrap onto a new line
  --log-level=...           Disable logging (verbose | debug | info | warning |
                            error | silent, default info)
  --log-limit=...           Maximum message count or 0 to disable (default 6)
  --log-override:X=Y        Use log level Y for log messages with identifier X
  --main-fields=...         Override the main file order in package.json
                            (default "browser,module,main" when platform is
                            browser and "main,module" when platform is node)
  --mangle-cache=...        Save "mangle props" decisions to a JSON file
  --mangle-props=...        Rename all properties matching a regular expression
  --mangle-quoted=...       Enable renaming of quoted properties (true | false)
  --metafile=...            Write metadata about the build to a JSON file
                            (see also: https://esbuild.github.io/analyze/)
  --minify-whitespace       Remove whitespace in output files
  --minify-identifiers      Shorten identifiers in output files
  --minify-syntax           Use equivalent but shorter syntax in output files
  --out-extension:.js=.mjs  Use a custom output extension instead of ".js"
  --outbase=...             The base path used to determine entry point output
                            paths (for multiple entry points)
  --preserve-symlinks       Disable symlink resolution for module lookup
  --public-path=...         Set the base URL for the "file" loader
  --pure:N                  Mark the name N as a pure function for tree shaking
  --reserve-props=...       Do not mangle these properties
  --resolve-extensions=...  A comma-separated list of implicit extensions
                            (default ".tsx,.ts,.jsx,.js,.css,.json")
  --serve-fallback=...      Serve this HTML page when the request doesn't match
  --servedir=...            What to serve in addition to generated output files
  --source-root=...         Sets the "sourceRoot" field in generated source maps
  --sourcefile=...          Set the source file for the source map (for stdin)
  --sourcemap=external      Do not link to the source map with a comment
  --sourcemap=inline        Emit the source map with an inline data URL
  --sources-content=false   Omit "sourcesContent" in generated source maps
  --supported:F=...         Consider syntax F to be supported (true | false)
  --tree-shaking=...        Force tree shaking on or off (false | true)
  --tsconfig=...            Use this tsconfig.json file instead of other ones
  --tsconfig-raw=...        Override all tsconfig.json files with this string
  --version                 Print the current version (0.28.2) and exit
  --watch-delay=...         Wait before watch mode rebuilds (in milliseconds)

Examples:
  # Produces dist/entry_point.js and dist/entry_point.js.map
  esbuild --bundle entry_point.js --outdir=dist --minify --sourcemap

  # Allow JSX syntax in .js files
  esbuild --bundle entry_point.js --outfile=out.js --loader:.js=jsx

  # Substitute the identifier RELEASE for the literal true
  esbuild example.js --outfile=out.js --define:RELEASE=true

  # Provide input via stdin, get output via stdout
  esbuild --minify --loader=ts < input.ts > output.js

  # Automatically rebuild when input files are changed
  esbuild app.ts --bundle --watch

  # Start a local HTTP server for everything in "www"
  esbuild app.ts --bundle --servedir=www --outdir=www/js
Options (61)
OptionDescriptionSource
--bundleBundle all dependencies into the output fileshelp
--format ...Output format (iife | cjs | esm, no default when not bundling, otherwise default is iife when platform is browser and cjs when platform is node)help
--minifyMinify the output (sets all --minify-* flags)help
--outdir ...The output directory (for multiple entry points)help
--outfile ...The output file (for one entry point)help
--packages ...Set to "external" to avoid bundling any packagehelp
--platform ...Platform target (browser | node | neutral, default browser)help
--serve ...Start a local HTTP server on this host:port for outputshelp
--sourcemapEmit a source maphelp
--splittingEnable code splitting (currently only for esm)help
--target ...Environment target (e.g. es2017, chrome58, firefox57, safari11, edge16, node10, ie9, opera45, default esnext)help
--watchWatch mode: rebuild on file system changes (stops when stdin is closed, use "--watch=forever" to ignore stdin)help
--abs-paths ...Emit absolute instead of relative paths in these situations (code | log | metafile)help
--allow-overwriteAllow output files to overwrite input fileshelp
--analyzePrint a report about the contents of the bundle (use "--analyze=verbose" for a detailed report)help
--asset-names ...Path template to use for "file" loader files (default "[name]-[hash]")help
--certfile ...Certificate for serving HTTPS (see also "--keyfile")help
--charset utf8Do not escape UTF-8 code pointshelp
--chunk-names ...Path template to use for code splitting chunks (default "[name]-[hash]")help
--color ...Force use of color terminal escapes (true | false)help
--cors-origin ...Allow cross-origin requests from this originhelp
--dropRemove certain constructs (console | debugger)help
--drop-labels ...Remove labeled statements with these label nameshelp
--entry-names ...Path template to use for entry point output paths (default "[dir]/[name]", can also use "[hash]")help
--global-name ...The name of the global for the IIFE formathelp
--ignore-annotationsEnable this to work with packages that have incorrect tree-shaking annotationshelp
--jsx-devUse React's automatic runtime in development modehelp
--jsx-factory ...What to use for JSX instead of React.createElementhelp
--jsx-fragment ...What to use for JSX instead of React.Fragmenthelp
--jsx-import-source ...Override the package name for the automatic runtime (default "react")help
--jsx-side-effectsDo not remove unused JSX expressionshelp
--jsx ...Set to "automatic" to use React's automatic runtime or to "preserve" to disable transforming JSX to JShelp
--keep-namesPreserve "name" on functions and classeshelp
--keyfile ...Key for serving HTTPS (see also "--certfile")help
--legal-comments ...Where to place legal comments (none | inline | eof | linked | external, default eof when bundling and inline otherwise)help
--line-limit ...Lines longer than this will be wrap onto a new linehelp
--log-level ...Disable logging (verbose | debug | info | warning | error | silent, default info)help
--log-limit ...Maximum message count or 0 to disable (default 6)help
--main-fields ...Override the main file order in package.json (default "browser,module,main" when platform is browser and "main,module" when platform is node)help
--mangle-cache ...Save "mangle props" decisions to a JSON filehelp
--mangle-props ...Rename all properties matching a regular expressionhelp
--mangle-quoted ...Enable renaming of quoted properties (true | false)help
--metafile ...Write metadata about the build to a JSON file (see also: https://esbuild.github.io/analyze/)help
--minify-whitespaceRemove whitespace in output fileshelp
--minify-identifiersShorten identifiers in output fileshelp
--minify-syntaxUse equivalent but shorter syntax in output fileshelp
--outbase ...The base path used to determine entry point output paths (for multiple entry points)help
--preserve-symlinksDisable symlink resolution for module lookuphelp
--public-path ...Set the base URL for the "file" loaderhelp
--reserve-props ...Do not mangle these propertieshelp
--resolve-extensions ...A comma-separated list of implicit extensions (default ".tsx,.ts,.jsx,.js,.css,.json")help
--serve-fallback ...Serve this HTML page when the request doesn't matchhelp
--servedir ...What to serve in addition to generated output fileshelp
--source-root ...Sets the "sourceRoot" field in generated source mapshelp
--sourcefile ...Set the source file for the source map (for stdin)help
--sources-content falseOmit "sourcesContent" in generated source mapshelp
--tree-shaking ...Force tree shaking on or off (false | true)help
--tsconfig ...Use this tsconfig.json file instead of other oneshelp
--tsconfig-raw ...Override all tsconfig.json files with this stringhelp
--versionPrint the current version (0.28.2) and exithelp
--watch-delay ...Wait before watch mode rebuilds (in milliseconds)help

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.