.\" Hey, EMACS: -*- nroff -*- .\" (C) Copyright 2020 Anthony Fok .\" .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH ESBUILD "1" "2021-02-01" "esbuild 0.8.39" "esbuild Manual" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .nh .ad l .SH NAME esbuild \- an extremely fast JavaScript bundler and minifier .SH SYNOPSIS .B esbuild .RI [ options ] .RI [ "entry points" ] .SH DESCRIPTION .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fBesbuild\fP is a JavaScript bundler and minifier. It packages up JavaScript and TypeScript code for distribution on the web. .PP Why build another JavaScript build tool? The current build tools for the web are at least an order of magnitude slower than they should be. It is hoped that this project serves as an \(lqexistence proof\(rq that JavaScript tooling can be much, much faster. .SH SIMPLE OPTIONS .TP .B \-\-bundle Bundle all dependencies into the output files .TP .BI \-\-define: K = V Substitute \fIK\fP with \fIV\fP while parsing .TP .BI \-\-external: M Exclude module \fIM\fP from the bundle .TP .BI \-\-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) .TP .BI \-\-global-name= ... The name of the global for the IIFE format .TP .BI \-\-jsx\-factory= ... What to use instead of React.createElement .TP .BI \-\-jsx\-fragment= ... What to use instead of React.Fragment .TP .BI \-\-loader: X = L Use loader \fIL\fP to load file extension \fIX\fP, where \fIL\fP is one of: js | jsx | ts | tsx | json | text | base64 | file | dataurl | binary .TP .B \-\-minify Sets all \-\-minify\-* flags .TP .B \-\-minify\-whitespace Remove whitespace .TP .B \-\-minify\-identifiers Shorten identifiers .TP .B \-\-minify\-syntax Use equivalent but shorter syntax .TP .BI \-\-outdir= ... The output directory (for multiple entry points) .TP .BI \-\-outfile= ... The output file (for one entry point) .TP .BI \-\-platform= ... Platform target (browser | node | neutral, default browser) .TP .BI \-\-serve= ... Start a local HTTP server on this host:port for outputs .TP .B \-\-sourcemap Emit a source map .TP .B \-\-splitting Enable code splitting (currently only for esm) .TP .B \-\-summary Print some helpful information at the end of a build .TP .BI \-\-target= ... Environment target (e.g. es2017, chrome58, firefox57, safari11, edge16, node10, default esnext) .TP .B \-\-watch Watch mode: rebuild on file system changes .SH ADVANCED OPTIONS .TP .BI \-\-banner= ... Text to be prepended to each output file .TP .B \-\-charset=utf8 Do not escape UTF-8 code points .TP .BI \-\-color= ... Force use of color terminal escapes (true | false) .TP .BI \-\-error\-limit= ... Maximum error count or 0 to disable (default 10) .TP .BI \-\-footer= ... Text to be appended to each output file .TP .BI \-\-inject: F Import the file \fIF\fP into all input files and automatically replace matching globals with imports .TP .B \-\-keep-names Preserve \(lqname\(rq on functions and classes .TP .BI \-\-log\-level= ... Disable logging (info | warning | error | silent, default info) .TP .BI \-\-main\-fields= ... Override the main file order in package.json (default \(lqbrowser,module,main\(rq when platform is browser and \(lqmain,module\(rq when platform is node) .TP .BI \-\-metafile= ... Write metadata about the build to a JSON file .TP .BI \-\-out\-extension: .js = .mjs Use a custom output extension instead of \(lq.js\(rq .TP .BI \-\-outbase= ... The base path used to determine entry point output paths (for multiple entry points) .TP .BI \-\-public\-path= ... Set the base URL for the \(lqfile\(rq loader .TP .BI \-\-pure: N Mark the name \fIN\fP as a pure function for tree shaking .TP .BI \-\-resolve\-extensions= ... A comma-separated list of implicit extensions (default \(lq.tsx,.ts,.jsx,.mjs,.cjs,.js,.css,.json\(rq) .TP .BI \-\-sourcefile= ... Set the source file for the source map (for stdin) .TP .B \-\-sourcemap=external Do not link to the source map with a comment .TP .B \-\-sourcemap=inline Emit the source map with an inline data URL .TP .B \-\-sources-content=false Omit \(lqsourcesContent\(rq in generated source maps .TP .BI \-\-tree\-shaking= ... Set to \(lqignore-annotations\(rq to work with packages .TP .BI \-\-tsconfig= ... Use this tsconfig.json file instead of other ones .TP .B \-\-version Print the current version (0.8.39) and exit .SH EXAMPLES .TP 4 .B esbuild \-\-bundle entry_point.js \-\-outdir=dist \-\-minify \-\-sourcemap # Produces dist/entry_point.js and dist/entry_point.js.map .TP .B esbuild \-\-bundle entry_point.js \-\-outfile=out.js \-\-loader:.js=jsx # Allow JSX syntax in .js files .TP .B esbuild example.js \-\-outfile=out.js \-\-define:RELEASE=true # Substitute the identifier RELEASE for the literal true .TP .B esbuild \-\-minify \-\-loader=ts < input.ts > output.js # Provide input via stdin, get output via stdout .SH AUTHOR esbuild is written by Evan Wallace. .PP This manual page is prepared for Debian by Anthony Fok using information from upstream README.md and output of \fBesbuild \-\-help\fP. .SH COPYRIGHT Copyright \(co 2020 Evan Wallace .br License: MIT (Expat) .SH SEE ALSO Documentation: \m[blue]\fBhttps://esbuild.github.io/\fR\m[] .PP Repository: \m[blue]\fBhttps://github.com/evanw/esbuild\fR\m[]