esbuild <entry points...>

An extremely fast JavaScript bundler

Arguments

NameDescription
entry pointsfilepaths

Options

NameDescription
--bundleBundle all dependencies into the output files
--define <name=value>Replace variable names with a literal value, eg. --define:DEBUG=true
--external <module specifier>Exclude modules from the build
--format <format>The output format
--loader <loaders>For a given file extension, specify a loader
--minifyMinify the output (sets all the --minify-* options)
--outdir <path>The output directory for multiple entrypoints
--outfile <path>The output file for one entrypoint
--platform <name>The platform target
--serve [[address:]port]Start a local HTTP server on this host:port
--splittingEnable code splitting
--target <target>Set the environment target. Can be a particular ES version or browser version, eg. chrome101
--watch [forever]Rebuild on file system changes
--allow-overwriteAllow output files to overwrite input files
--analyze [verbose]Print a report about the contents of the bundle
--asset-names <template>Path template for 'file' loader files
--banner <ext=text[,ext=text...]>Text to be prepended to each output file type
--charset <arg>Use UTF-8 instead of escaped codepoints in ASCII
--chunk-names <template>Path template to use for code splitting chunks
--color <enabled>Force use of terminal colors
--drop <arg>Remove certain constructs
--entry-names <template>Path template to use for entry point output paths
--footer <ext=text>Text to be appended to each file type
--global-name <name>The name of the global if using --format=iife
--ignore-annotationsEnable this to work with packages that have incorrect tree-shaking annotations
--inject <import>Import the file into all input files, automatically replace matching globals
--jsx-factory <factory>What to use for the JSX factory
--jsx-fragment <fragment>What to use for the JS Fragment factory
--jsx <arg>Preserve JSX instead of transforming
--jsx-devToggles development mode for the automatic runtime
--jsx-import-source <source>Overrides the root import for runtime functions (default: react)
--keep-namesPreserve 'name' on functions and classes
--legal-comments <location>Where to place legal comments
--log-level <level>Set the log level
--log-limit <count>Maximum message count, 0 to disable
--log-override <identifier:level>For a particular identifier, set the log level
--main-fields <field order>Override the main file order in package.json
--mangle-cache <path>Save 'mangle props' decisions to a JSON file
--mangle-props <regex>Rename all properties matching a regular expression
--mangle-quoted <status>Enable mangling (renaming) quoted properties
--metafile <path>Write metadata about the build to a JSON file
--minify-whitespaceRemove unnecessary whitespace in output files
--minify-identifiersShorten identifiers in output files
--minify-syntaxUse equivalent but shorter syntax in output files
--out-extension <ext=new>Use a custom output extension for each extension
--outbase <path>Base path used to determine entrypoint output paths, for multiple entrypoints
--preserve-symlinksDisable symlink resolution
--public-path <path>Set the base URL for the 'file' loader
--pure <name>Mark the name as a pure function for tree shaking
--reserve-props <properties>Do not mangle these properties
--resolve-extensions <extensions>Comma-separated list of implicit extensions
--servedir <path>What to serve in addition to the generated output files
--source-root <URL>Set the sourceRoot field in generated source maps
--sourcefile <name>Set the source file for the source map if there's no file name to use
--sourcemap [options]Generate source maps?
--sources-content <arg>Omit the sourcesContent field in generated source maps
--supported <syntax=status>Consider a given syntax to be supported
--tree-shaking <status>Force tree shaking on or off
--tsconfig <path>Use this TypeScript config instead of the default
--versionPrint the current version and exit