Forrest logo
tool overview
On this page you find all important commands for the CLI tool esbuild. If the command you are looking for is missing please ask our AI.

esbuild

Esbuild is a fast and lightweight command line tool for bundling and optimizing JavaScript and TypeScript code. It is designed to be highly performant, enabling quick builds even for large projects.

Some key features of esbuild include:

  1. Fast builds: Esbuild is known for its incredible speed, making it one of the fastest bundlers available. It achieves this speed by leveraging parallel processing and optimized algorithms.

  2. Zero configuration: Esbuild aims to provide a zero-config setup by inferring most of the necessary settings from the project's directory structure and file extensions. This makes it easy to get started without needing to write complex configuration files.

  3. JavaScript and TypeScript support: Esbuild can handle both JavaScript and TypeScript code, allowing you to bundle and optimize projects written in either language.

  4. Tree shaking: It performs aggressive tree shaking, which means that it analyzes your code and eliminates any unused or dead code from the final bundle. This helps reduce the bundle size and improves the overall performance of your application.

  5. Support for various module formats: Esbuild supports different module formats, including CommonJS, ES modules, and AMD. This flexibility allows you to use esbuild in various project setups and integrate it with different build systems.

  6. Integration with other build tools: Esbuild can be used as a standalone command line tool, but it also provides a JavaScript API that allows you to integrate it with other build tools. This gives you the flexibility to customize and automate your build process.

Overall, esbuild is a powerful and efficient bundler tool that simplifies the process of bundling and optimizing JavaScript and TypeScript code, making it a popular choice among developers seeking fast builds and minimal configuration.

List of commands for esbuild:

  • esbuild:tldr:55aa7 esbuild: Bundle a list of files to an output directory.
    $ esbuild --bundle --outdir=${path-to-output_directory} ${filename1 filename2 ---}
    try on your machine
    explain this command
  • esbuild:tldr:74b21 esbuild: Bundle a JSX application from `stdin`.
    $ esbuild --bundle --outfile=${path-to-out-js} < ${filename-jsx}
    try on your machine
    explain this command
  • esbuild:tldr:8c686 esbuild: Bundle a JavaScript application for a specific node version.
    $ esbuild --bundle --platform=${node} --target=${node12} ${filename-js}
    try on your machine
    explain this command
  • esbuild:tldr:91d31 esbuild: Bundle and serve a JavaScript application on an HTTP server.
    $ esbuild --bundle --serve=${port} --outfile=${index-js} ${filename-js}
    try on your machine
    explain this command
  • esbuild:tldr:b03f9 esbuild: Bundle a JSX application for a comma-separated list of browsers.
    $ esbuild --bundle --minify --sourcemap --target=${chrome58,firefox57,safari11,edge16} ${filename-jsx}
    try on your machine
    explain this command
  • esbuild:tldr:c1840 esbuild: Bundle and minify a JSX application with source maps in `production` mode.
    $ esbuild --bundle --define:${process-env-NODE_ENV=\"production\"} --minify --sourcemap ${filename-js}
    try on your machine
    explain this command
  • esbuild:tldr:c861e esbuild: Bundle a JavaScript application enabling JSX syntax in `.js` files.
    $ esbuild --bundle app.js --loader:${-js=jsx} ${filename-js}
    try on your machine
    explain this command
  • esbuild:tldr:f56d6 esbuild: Bundle a JavaScript application and print to `stdout`.
    $ esbuild --bundle ${filename-js}
    try on your machine
    explain this command
tool overview