03-build-config — Claude Code prompt for esbuild setup
The 03-build-config prompt guides Claude Code through setting up an esbuild build for a TypeScript and TSX CLI. Use it to produce dist/cli.mjs for Bun or Node.js 20+.
no license ★ 3,444 updated 2026-10-14
.claude/commands/03-build-config.mdWhat 03-build-config does
The prompt lays out an esbuild configuration with src/entrypoints/cli.tsx as the entry point. It covers JSX handling, mapping bun:bundle to src/shims/bun-bundle.ts, injecting MACRO from src/shims/macro.ts, and resolving .js imports to TypeScript files. The intended output is an ESM bundle at dist/cli.mjs, with source maps.
It also asks Claude Code to work through build errors, add build, build:watch, and build:prod scripts to package.json, and ignore dist/ in .gitignore. Watch mode and minification are included. Bun is the primary runtime; the Node.js target is version 20, so earlier Node releases fall outside the stated target. The final check runs the bundled CLI with --version.
What it helps with
- bundle the CLI from the
src/tree - redirect
bun:bundleand inject theMACROglobal - handle JSX and
.jsimports that resolve to TypeScript files - add build and watch commands to
package.json - check
dist/cli.mjsunder Bun or Node.js 20+
Example prompts for the agent
- Set up an esbuild build for the CLI using
03-build-config.md, then checkdist/cli.mjs --version. - Add the build scripts and watch mode described in
03-build-config.md. - Work through the build errors and configure aliases and externals as directed by
03-build-config.md.
How to install 03-build-config
Manually: put the files in place
.claude/commands/03-build-config.mdHow to use
Paste the text at the start of a chat or into project instructions
Questions about 03-build-config
How do I install 03-build-config in Claude Code?
Save the file as .claude/commands/03-build-config.md. Then invoke it by its command name in Claude Code.
What does 03-build-config do?
It guides Claude Code through bundling a TypeScript and TSX CLI with esbuild into dist/cli.mjs. It also covers build scripts and a runtime check.
Which runtimes does the build target?
Bun is the primary runtime. Node.js 20+ is the secondary target.