esbuild-config
raw JSON → 1.0.1 verified Fri May 01 auth: no javascript
A Rust-based CLI tool that converts a JSON configuration file (esbuild.config.json) into command-line arguments for esbuild. Version 1.0.1, released with Windows binary path fix and arm64 support on macOS/Linux. Unlike other config wrappers, esbuild-config does no validation, making it version-independent; it only translates JSON types to esbuild's argument format. It can be installed via npm, Cargo, or precompiled binaries. The project is developed in Rust and is currently in active maintenance mode.
Common errors
error error: Unknown command: esbuild-config ↓
cause esbuild-config is not installed or not in PATH.
fix
Install globally: npm install --global esbuild-config
error error: No such file: esbuild.config.json ↓
cause The current directory does not contain a config file, and no file path is provided.
fix
Create esbuild.config.json or specify a path: esbuild $(esbuild-config ./path/to/config.json)
Warnings
gotcha The package does not validate configuration values; invalid options will be passed to esbuild and may cause errors. ↓
fix Double-check all config keys against esbuild's CLI options.
gotcha The entry field is moved to the end of the argument list automatically. If you pass multiple entry points as an array, they will all appear at the end. ↓
fix Use an array for multiple entry points, and note that the order in the array determines the order in the output.
Install
npm install esbuild-config yarn add esbuild-config pnpm add esbuild-config Imports
- esbuild-config wrong
require('esbuild-config')correctnpx esbuild-config - esbuild.config.json wrong
Importing a default config from node_modulescorrectCreate esbuild.config.json and run `esbuild $(esbuild-config)`
Quickstart
echo '{
"entry": "./index.js",
"outfile": "./bundle.js",
"external": ["react", "react-dom"],
"loader": { ".js": "jsx", ".png": "base64" },
"minify": true
}' > esbuild.config.json
npx esbuild-config