ESBUILD(1)
π ESBUILD(1) β the esbuild Manual π
okay bestie, sit down, hydrate, because we are about to talk about the fastest little build tool in the whole group chat. this is the manual page for esbuild, and yes it lives in the esbuild Manual section, and yes it's giving main character energy. periodt.
β¨ NAME β¨
esbuild β an extremely fast JavaScript bundler and minifier π¦
πΈ SYNOPSIS πΈ
esbuild [options] [entry points]
π DESCRIPTION π
esbuild is a JavaScript bundler and minifier. it packages up JavaScript and TypeScript code for distribution on the web. that's it, that's the job, and it does it so fast it's actually rude.
now β why would anyone build another JavaScript build tool, you ask? valid question, queen. the tea is this: the current build tools for the web are at least an order of magnitude slower than they should be. not a little slower. an order of magnitude. π
the hope is that this project serves as an βexistence proofβ that JavaScript tooling can be much, much faster. and bestie, it ate. π₯
π SIMPLE OPTIONS π
--bundleβ bundle ALL the dependencies into the output files. everyone gets in the car. π--define:K=Vβ substituteKwithVwhile parsing--external:Mβ exclude moduleMfrom the bundle (you can use*wildcards, go wild) π--format=...β output format (iife|cjs|esm, no default when not bundling, otherwise default isiifewhen platform is browser andcjswhen platform is node)--loader:X=Lβ use loaderLto load file extensionX, whereLis one of:base64|binary|copy|css|dataurl|empty|file|global-css|js|json|jsx|local-css|text|ts|tsx--minifyβ minify the output (this sets all the--minify-*flags, so it's a package deal π )--outdir=...β the output directory (for multiple entry points)--outfile=...β the output file (for one entry point)--packages=...β set toexternalto avoid bundling any package--platform=...β platform target (browser|node|neutral, defaultbrowser)--serve=...β start a local HTTP server on this host:port for outputs--sourcemapβ emit a source map--splittingβ enable code splitting (currently only foresm)--target=...β environment target (e.g.es2017,chrome58,firefox57,safari11,edge16,node10,ie9,opera45, defaultesnext)--watchβ watch mode: rebuild on file system changes (it stops when stdin is closed, use β--watch=foreverβ to ignore stdin)
π ADVANCED OPTIONS π
--allow-overwriteβ allow output files to overwrite input files. chaotic. be careful, bestie. β οΈ--analyzeβ print a report about the contents of the bundle (use β--analyze=verboseβ for a detailed report)--asset-names=...β path template to use forfileloader files (default[name]-[hash])--banner:T=...β text to be prepended to each output file of typeTwhereTis 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)--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 typeTwhereTis 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 fileFinto 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 ofReact.createElement--jsx-fragment=...β what to use for JSX instead ofReact.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, defaulteofwhen bundling andinlineotherwise)--line-limit=...β lines longer than this will be wrap onto a new line--log-level=...β disable logging (verbose|debug|info|warning|error|silent, defaultinfo)--log-limit=...β maximum message count or0to disable (default6)--log-override:X=Yβ use log levelYfor log messages with identifierX--main-fields=...β override the main file order inpackage.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 thefileloader--pure:Nβ mark the nameNas 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 syntaxFto be supported (true|false)--tree-shaking=...β force tree shaking on or off (false|true)--tsconfig=...β use thistsconfig.jsonfile instead of other ones--tsconfig-raw=...β override alltsconfig.jsonfiles with this string--versionβ print the current version (0.25.0) and exit
π EXAMPLES π
esbuild --bundle entry_point.js --outdir=dist --minify --sourcemap
# Produces dist/entry_point.js and dist/entry_point.js.map
esbuild --bundle entry_point.js --outfile=out.js --loader:.js=jsx
# Allow JSX syntax in .js files
esbuild example.js --outfile=out.js --define:RELEASE=true
# Substitute the identifier RELEASE for the literal true
esbuild --minify --loader=ts < input.ts > output.js
# Provide input via stdin, get output via stdout
esbuild app.ts --bundle --watch
# Automatically rebuild when input files are changed
esbuild app.ts --bundle --servedir=www --outdir=www/js
# Start a local HTTP server for everything in βwwwβ
look at those. so clean. so crisp. π§
π«Ά AUTHOR π«Ά
esbuild is written by Evan Wallace. absolute icon. π
this manual page is prepared for Debian by Anthony Fok using information from upstream README.md and output of esbuild --help. thank you for your service. π«‘
β COPYRIGHT β
Copyright Β© 2020 Evan Wallace License: MIT (Expat)
π¦ SEE ALSO π¦
- Documentation:
https://esbuild.github.io/ - Repository:
https://github.com/evanw/esbuild
okay that's the whole thing, no cap, every single flag accounted for. π
this was esbuild 0.25.0, dated 2025-02-13, straight out of the esbuild Manual. go build something iconic bestie, and remember β bundle responsibly. π
β¨
π¦ where this page comes from
- debian trixie: esbuild 0.25.5-1+b1 Β· MIT
- ubuntu questing: esbuild 0.25.5-1
- ubuntu resolute: esbuild 0.27.2-1 Β· MIT
- ubuntu stonking: esbuild 0.28.2-1 Β· MIT
- Copyright 2020-2024 Anthony Fok <foka@debian.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms