# 03-build-config

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+.

- prompt · `type=prompt` · Claude Code, ChatGPT · ★ 3444 repo stars
- Author: codeaashu
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/codeaashu/claude-code/tree/HEAD/prompts/03-build-config.md
- Updated: 2026-10-14
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/prompts/03-build-config

## What it 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`.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/commands/03-build-config.md`

### ChatGPT

**How to use**
- Paste the text at the start of a chat or into project instructions

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/codeaashu/claude-code/tree/HEAD/prompts/03-build-config.md

## When to use it
- 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
- 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`.

## Similar
- [bun-runtime](https://affpapa.org/en/nevibecode/skills/bun-runtime.md) — skill · 6500 installs
- [bun-bundler](https://affpapa.org/en/nevibecode/skills/bun-bundler.md) — skill · 420 installs
- [netlify-config](https://affpapa.org/en/nevibecode/skills/netlify-config.md) — skill · 3700 installs
- [bun-development](https://affpapa.org/en/nevibecode/skills/bun-development.md) — skill · 2900 installs
- [guide](https://affpapa.org/en/nevibecode/skills/guide.md) — skill · 550 installs
- [bun-workers](https://affpapa.org/en/nevibecode/skills/bun-workers.md) — skill · 422 installs

From the same set: [codeaashu/claude-code](https://affpapa.org/en/nevibecode/by/codeaashu/claude-code.md) — 17 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
