Skip to content

Bun's esbuild-compatible JavaScript and TypeScript bundler, covering CLI and Bun.build usage for production builds.

CCM score
52 of 100
skills.sh installs
423
GitHub stars
257
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers bundling workflows for browser, Bun, and Node targets, including code splitting, minification, and sourcemaps
  • Documents the bun build CLI flags (--outdir, --target, --format, --splitting, --sourcemap) alongside the equivalent Bun.build options
  • Includes loader mappings for JS, TS, JSX, JSON, TOML, text, file, base64, dataurl, and CSS, plus a plugin API with resolve and load hooks
  • Designed for developers building production bundles or libraries who need to handle Bun.build errors with try/catch

Install

$ npx -y skills add secondsky/claude-skills --skill bun-bundler -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Bun Bundler

Bun's bundler is a fast JavaScript/TypeScript bundler built on the same engine as Bun's runtime. It's an esbuild-compatible alternative with native performance.

Quick Start

CLI

# Basic bundle
bun build ./src/index.ts --outdir ./dist

# Production build
bun build ./src/index.ts --outdir ./dist --minify

# Multiple entry points
bun build ./src/index.ts ./src/worker.ts --outdir ./dist

JavaScript API

// Since Bun 1.2, Bun.build REJECTS on failure (throws).
// Wrap in try/catch to handle errors; pass { throw: false } to restore the
// old resolve-with-{ success, logs } contract if you prefer that style.
try {
  const result = await Bun.build({
    entrypoints: ["./src/index.ts"],
    outdir: "./dist",
  });
  console.log(`Built ${result.outputs.length} files`);
} catch (err) {
  console.error("Build failed:", err);
  process.exit(1);
}

Bun.build Options

await Bun.build({
  // Entry points (required)
  entrypoints: ["./src/index.ts"],

  // Output directory
  outdir: "./dist",

  // Target environment
  target: "browser",  // "browser" | "bun" | "node"

Details

Repository
github.com/secondsky/claude-skills
Categories
Frontend & UI Code, Technical Documentation, CLI & Terminal
First seen
Jun 3, 2026

Questions

What does the bun-bundler skill do?

The bun-bundler skill teaches the agent to use Bun's built-in bundler, which bundles JavaScript and TypeScript with options for code splitting, minification, sourcemaps and tree shaking. It covers the bun build CLI, the Bun.build JavaScript API, target environments for browser, Bun and Node, and custom plugins and loaders.

How do I install the bun-bundler skill?

Run npx -y skills add secondsky/claude-skills --skill bun-bundler -y in a project to install it. Once installed, bun-bundler lets the agent write Bun.build calls and bun build commands for production bundles.

Is bun-bundler a good alternative to esbuild?

bun-bundler is listed in the Frontend and UI Code category on Claude Marketplaces, alongside vercel-react-best-practices, web-design-guidelines and design-taste-frontend. It targets Bun's esbuild-compatible bundler, so it suits projects that already build with Bun and want a native alternative to esbuild.

Does bun-bundler need any API keys or extra tools?

bun-bundler works with Bun's built-in bundler and needs no API keys or accounts. The skill's guidance assumes Bun is installed in the project, and its build scripts run with bun run build.ts.

More from secondsky/claude-skills

All 116

Similar to Bun Bundler

More Frontend & UI Code