Skip to main content
prompt GP ChatGPT

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/03-build-config.md
Open on GitHub

What 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:bundle and inject the MACRO global
  • handle JSX and .js imports that resolve to TypeScript files
  • add build and watch commands to package.json
  • check dist/cli.mjs under Bun or Node.js 20+

Example prompts for the agent

  • Set up an esbuild build for the CLI using 03-build-config.md, then check dist/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.md

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.

Similar prompts

All prompts for DevOps and infrastructure →

From the same set17

The whole set →
05-env-and-auth 05-env-and-auth sets up environment variables and tests API connectivity in claude-code workspaces. Creates a documented .env.example and builds a test script for Bun. GP ChatGPT ★ 3,444repo stars 07-tool-system 07-tool-system is a Claude Code prompt for auditing the CLI tool interface, registry, and imports. It also asks for a smoke test that loads the available tools. GP ChatGPT ★ 3,444repo stars 06-ink-react-terminal-ui 06-ink-react-terminal-ui — a Claude prompt that follows the React + Ink render path in the claude-code repo, checks the components and theme, and ends with a working terminal render test. GP ChatGPT ★ 3,444repo stars 14-dev-runner The 14-dev-runner prompt configures a development runner for Claude Code to execute TypeScript directly with Bun. It eliminates the need for full production builds during iterative work. GP ChatGPT ★ 3,444repo stars 09-query-engine The 09-query-engine prompt guides an architecture review of QueryEngine and a basic conversation test against the Anthropic API. Use it to trace requests, streaming events, and tool calls. GP ChatGPT ★ 3,444repo stars 12-services-layer 12-services-layer — a prompt that configures Claude Code CLI background services: analytics, policy limits, remote settings, session memory, and bootstrap data. GP ChatGPT ★ 3,444repo stars 02-runtime-shims 02-runtime-shims is a Claude Code prompt that creates runtime shims for bun:bundle flags and MACRO globals to run CLI source without Bun. GP ChatGPT ★ 3,444repo stars Claude Code Explorer MCP Claude Code Explorer MCP — an MCP server that lets your agent browse the Claude source: tool and slash-command listings, code search, architecture overview. CX Codex +1 ★ 3,444repo stars

Project sponsors

Companies that keep this analytics open