ESBUILD-WASM(1)
π NAME π
ok so welcome to esbuild-wasm(1) β this is the manual for esbuild, the extremely fast JavaScript bundler and minifier. no cap, that's literally what it does. π¦
β¨ SYNOPSIS β¨
esbuild [options] [entry points]
that's it bestie, options then your entry points, go off π
πΈ DESCRIPTION πΈ
esbuild is a JavaScript bundler and minifier. She packages up your JavaScript and TypeScript code so it's ready to be distributed on the web. π
so like... why would anyone build another JavaScript build tool? because the build tools we have rn are at least an order of magnitude slower than they should be. that's not a vibe, that's a tragedy. the hope here is that this project serves as an βexistence proofβ β proof that JavaScript tooling can be much, much faster. it's giving main character energy for the entire ecosystem π
π SIMPLE OPTIONS π
--bundleβ bundle all your dependencies straight into the output files π«Ά--define:K=Vβ swapKout forVwhile parsing, sneakily--external:Mβ keep moduleMOUT of the bundle (you can use*wildcards here, slay)--format=...β what the output format is (iife|cjs|esm). when you're not bundling there's no default; otherwise the default isiifewhen the platform is browser andcjswhen the 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, she's an overachiever π)--outdir=...β the output directory (this one's for when you have multiple entry points)--outfile=...β the output file (and this one's for when you have just one entry point)--packages=...β set it toexternalto avoid bundling any package at all--platform=...β platform target (browser|node|neutral, defaultbrowser)--serve=...β start a local HTTP server on thishost:portfor your outputs π--sourcemapβ emit a source map--splittingβ enable code splitting (currently only foresm, okurrr)--target=...β environment target (e.g.es2017,chrome58,firefox57,safari11,edge16,node10,ie9,opera45, defaultesnext)--watchβ watch mode: rebuild whenever the file system changes. it stops when stdin is closed, so if you want it to ignore stdin use--watch=foreverπ
π ADVANCED OPTIONS π
--allow-overwriteβ let output files overwrite input files (chaotic, but okay)--analyzeβ print a report about what's actually inside the bundle (use--analyze=verbosefor the detailed version)--asset-names=...β path template forfileloader files (default[name]-[hash])--banner:T=...β text to be prepended to each output file of typeT, whereTis 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 for code splitting chunks (default[name]-[hash])--color=...β force color terminal escapes on or off (true|false)--drop:...β remove certain constructs (console|debugger)--drop-labels=...β remove labeled statements with these label names--entry-names=...β path template for entry point output paths (default[dir]/[name], you can also use[hash])--footer:T=...β text to be appended to each output file of typeT, whereTis 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 (defaultreact)--jsx-side-effectsβ do not remove unused JSX expressions--jsx=...β set toautomaticto use React's automatic runtime, or topreserveto 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 wrapped onto a new line--log-level=...β disable logging (verbose|debug|info|warning|error|silent, defaultinfo)--log-limit=...β maximum message count, or0to disable it (default6)--log-override:X=Yβ use log levelYfor log messages with identifierX--main-fields=...β override the main file order inpackage.json(defaultbrowser,module,mainwhen platform is browser andmain,modulewhen platform is node)--mangle-cache=...β save the β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 (hands off π«³)--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 the 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 the 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β
π AUTHOR π
esbuild is written by Evan Wallace. π
This manual page is prepared for Debian by Anthony Fok using information from the upstream README.md and the output of esbuild --help. π«Ά
β COPYRIGHT β
Copyright Β© 2020 Evan Wallace
License: MIT (Expat)
π¦ SEE ALSO π¦
- Documentation:
https://esbuild.github.io/ - Repository:
https://github.com/evanw/esbuild
okay bestie that's the whole page, you're officially esbuild-pilled π go bundle something iconic β¨
and that's a wrap on version esbuild 0.25.0, dated 2025-02-13 β this was ESBUILD-WASM(1), ty for coming to my ted talk ππ
π¦ where this page comes from
- ubuntu stonking: esbuild-wasm 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