esbuild-deploy

raw JSON →
1.0.1 verified Fri May 01 auth: no javascript

esbuild-deploy is a zero-config CLI tool that bundles Node.js applications for deployment using esbuild, eliminating the need to ship node_modules. It automatically detects ESM or CJS module systems from package.json fields (type, main, module), and produces minimal bundles in a deploy/ directory. Version 1.0.1 is the latest stable release, with types included. Key differentiators: automatic esbuild configuration, no manual setup, and compatibility injection for ESM/CJS interop. Part of a beta-then-1.0 transition with several beta releases prior.

error Error: Cannot find module 'esbuild-deploy'
cause Package not installed globally or not in node_modules.
fix
Install as devDependency: npm install --save-dev esbuild-deploy
error Error: esbuild-deploy requires Node.js version >=20.19.2
cause Node.js version is too old.
fix
Upgrade Node.js to >=20.19.2.
gotcha Requires Node.js >=20.19.2 — older versions will fail to install or run.
fix Update Node.js to >=20.19.2.
gotcha Does not perform TypeScript type checking; only transpilation via esbuild. Type errors won't be caught during bundling.
fix Run tsc separately before esbuild-deploy for TypeScript projects.
breaking Breaking change from beta: in v1.0.0-beta.x the entry point detection logic differed. Ensure your package.json has 'type', 'main', or 'module' properly set.
fix Update to v1.0.0 and adjust package.json fields if needed.
gotcha The --outdir default is './deploy' — this directory will be overwritten each run. Ensure you don't have important files there.
fix Use -o or --outdir to specify a different output directory.
npm install esbuild-deploy
yarn add esbuild-deploy
pnpm add esbuild-deploy

Shows how to add esbuild-deploy as a build script and run it.

{
  "scripts": {
    "build": "esbuild-deploy"
  }
}
// Run: npm run build
// Output goes to ./deploy (configurable via --outdir)