Skip to content
Agentmart
Submit a tool

Bun esbuild

Migration guide from esbuild to Bun's bundler

Skill by jarle

IndexedMIT★ 9
Write a review

Chalk Labs

Need help deploying Bun esbuild?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/jarle-bun-esbuild

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Migration guide from esbuild to Bun's bundler

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/bun-esbuild

What's inside

Skill name
Bun esbuild
Description
Migration guide from esbuild to Bun's bundler
License
MIT
Instructions
297 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • name: only lowercase letters, digits and single hyphens allowed
  • name: "Bun esbuild" does not match folder "bun-bundler-esbuild"

Files (1)

  • SKILL.md

SKILL.md (first lines)

# esbuild

> Migration guide from esbuild to Bun's bundler

Bun's bundler API is inspired heavily by esbuild. Migrating to Bun's bundler from esbuild should be relatively painless. This guide will briefly explain why you might consider migrating to Bun's bundler and provide a side-by-side API comparison reference for those who are already familiar with esbuild's API.

There are a few behavioral differences to note.

<Note>
  **Bundling by default.** Unlike esbuild, Bun always bundles by default. This is why the `--bundle` flag isn't
  necessary in the Bun example. To transpile each file individually, use `Bun.Transpiler`.
</Note>

<Note>
  **It's just a bundler.** Unlike esbuild, Bun's bundler does not include a built-in development server or file watcher.
  It's just a bundler. The bundler is intended for use in conjunction with `Bun.serve` and other runtime APIs to achieve
  the same effect. As such, all options relating to HTTP/file watching are not applicable.
</Note>

## Performance

With a performance-minded API coupled with the extensively optimized Zig-based JS/TS parser, Bun's bundler is 1.75x faster than esbuild on esbuild's three.js benchmark.

<Info>Bundling 10 copies of three.js from scratch, with sourcemaps and minification</Info>

## CLI API

Bun and esbuild both provide a command-line interface.

```bash terminal icon="terminal" theme={"theme":{"light":"github-light","dark":"dracula"}}
# esbuild
esbuild <entrypoint> --outdir=out --bundle

# bun
bun build <entrypoint> --outdir=out
```

In Bun's CLI, simple boolean flags like `--minify` do not accept an argument. Other flags like `--outdir <path>` do accept an argument; these flags can be written as `--outdir out` or `--outdir=out`. Some flags like `--define` can be specified several times: `--define foo=bar --define bar=baz`.

| esbuild                | bun build                  | Notes                                                                                                                                                                                                                                                                                                                                                                   |
| ---------------------- | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--bundle`             | n/a                        | Bun always bundles, use `--no-bundle` to disable this behavior.                                                                                                                                                                                                                                                                                                         |
| `--define:K=V`         | `--define K=V`             | Small syntax difference; no colon.<br />`esbuild --define:foo=bar`<br />`bun build --define foo=bar`                                                                                                                                                                                                                                                                    |
| `--external:<pkg>`     | `--external <pkg>`         | Small syntax difference; no colon.<br />`esbuild --external:react`<br />`bun build --external react`                                                                                                                                                                                                                                                                    |
| `--format`             | `--format`                 | Bun supports `"esm"` and `"cjs"` currently, but more module formats are planned. esbuild defaults to `"iife"`.                                                                                                                                                                                                                                                          |
| `--loader:.ext=loader` | `--loader .ext:loader`     | Bun supports a different set of built-in loaders than esbuild; see Bundler > Loaders for a complete reference. The esbuild loaders `dataurl`, `binary`, `base64`, `copy`, and `empty` are not yet implemented.<br /><br />The syntax for `--loader` is slightly different.<br />`esbuild app.ts --bundle --loader:.svg=text`<br />`bun build app.ts --loader .svg:text` |
| `--minify`             | `--minify`                 | No differences                                                                                                                                                                                                                                                                                                                                                          |
| `--outdir`             | `--outdir`                 | No differences                                                                                                                                                                                                                                                                                                                                                          |
| `--outfile`            | `--outfile`                | No differences                                                                                                                                                                                                                                                                                                                                                          |
| `--packages`           | `--packages`               | No differences                                                                                                                                                                                                                                                                                                                                                          |
| `--platform`           | `--target`                 | Renamed to `--target` for consistency with tsconfig. Does not support `neutral`.                                                                                                                                                                                                                                                                                        |
| `--serve`              | n/a                        | Not applicable                                                                                                                                                                                                                                                                                                                                                          |
| `--sourcemap`          | `--sourcemap`              | No differences                                                                                                                                                                                                                                                                                                                                                          |
| `--splitting`          | `--splitting`              | No differences                                                                                                                                                                                                                                                                                                                                                          |
| `--target`             | n/a                        | Not supported. Bun's bundler performs no syntactic down-leveling at this time.                                                                                                                                                                                                                                                                                          |
| `--watch`              | `--watch`                  | No differences                                                                                                                                                                                                                                                                                                                                                          |
| `--allow-overwrite`    | n/a                        | Overwriting is never allowed                                                                                                                                                                                                                                                                                                                                            |
| `--analyze`            | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--asset-names`        | `--asset-naming`           | Renamed for consistency with naming in JS API                                                                                                                                                                                                                                                                                                                           |
| `--banner`             | `--banner`                 | Only applies to js bundles                                                                                                                                                                                                                                                                                                                                              |
| `--footer`             | `--footer`                 | Only applies to js bundles                                                                                                                                                                                                                                                                                                                                              |
| `--certfile`           | n/a                        | Not applicable                                                                                                                                                                                                                                                                                                                                                          |
| `--charset=utf8`       | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--chunk-names`        | `--chunk-naming`           | Renamed for consistency with naming in JS API                                                                                                                                                                                                                                                                                                                           |
| `--color`              | n/a                        | Always enabled                                                                                                                                                                                                                                                                                                                                                          |
| `--drop`               | `--drop`                   |                                                                                                                                                                                                                                                                                                                                                                         |
| n/a                    | `--feature`                | Bun-specific. Enable feature flags for compile-time dead-code elimination via `import { feature } from "bun:bundle"`                                                                                                                                                                                                                                                    |
| `--entry-names`        | `--entry-naming`           | Renamed for consistency with naming in JS API                                                                                                                                                                                                                                                                                                                           |
| `--global-name`        | n/a                        | Not applicable, Bun does not support `iife` output at this time                                                                                                                                                                                                                                                                                                         |
| `--ignore-annotations` | `--ignore-dce-annotations` |                                                                                                                                                                                                                                                                                                                                                                         |
| `--inject`             | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--jsx`                | `--jsx-runtime <runtime>`  | Supports `"automatic"` (uses jsx transform) and `"classic"` (uses `React.createElement`)                                                                                                                                                                                                                                                                                |
| `--jsx-dev`            | n/a                        | Bun reads `compilerOptions.jsx` from `tsconfig.json` to determine a default. If `compilerOptions.jsx` is `"react-jsx"`, or if `NODE_ENV=production`, Bun will use the jsx transform. Otherwise, it uses `jsxDEV`. The bundler does not support `preserve`.                                                                                                              |
| `--jsx-factory`        | `--jsx-factory`            |                                                                                                                                                                                                                                                                                                                                                                         |
| `--jsx-fragment`       | `--jsx-fragment`           |                                                                                                                                                                                                                                                                                                                                                                         |
| `--jsx-import-source`  | `--jsx-import-source`      |                                                                                                                                                                                                                                                                                                                                                                         |
| `--jsx-side-effects`   | n/a                        | JSX is always assumed to be side-effect-free                                                                                                                                                                                                                                                                                                                            |
| `--keep-names`         | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--keyfile`            | n/a                        | Not applicable                                                                                                                                                                                                                                                                                                                                                          |
| `--legal-comments`     | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--log-level`          | n/a                        | Not supported. This can be set in `bunfig.toml` as `logLevel`.                                                                                                                                                                                                                                                                                                          |
| `--log-limit`          | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--log-override:X=Y`   | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--main-fields`        | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--mangle-cache`       | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--mangle-props`       | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--mangle-quoted`      | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--metafile`           | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--minify-whitespace`  | `--minify-whitespace`      |                                                                                                                                                                                                                                                                                                                                                                         |
| `--minify-identifiers` | `--minify-identifiers`     |                                                                                                                                                                                                                                                                                                                                                                         |
| `--minify-syntax`      | `--minify-syntax`          |                                                                                                                                                                                                                                                                                                                                                                         |
| `--out-extension`      | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--outbase`            | `--root`                   |                                                                                                                                                                                                                                                                                                                                                                         |
| `--preserve-symlinks`  | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--public-path`        | `--public-path`            |                                                                                                                                                                                                                                                                                                                                                                         |
| `--pure`               | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--reserve-props`      | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--resolve-extensions` | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--servedir`           | n/a                        | Not applicable                                                                                                                                                                                                                                                                                                                                                          |
| `--source-root`        | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--sourcefile`         | n/a                        | Not supported. Bun does not support stdin input yet.                                                                                                                                                                                                                                                                                                                    |
| `--sourcemap`          | `--sourcemap`              | No differences                                                                                                                                                                                                                                                                                                                                                          |
| `--sources-content`    | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--supported`          | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                           |
| `--tree-shaking`       | n/a                        | Always true                                                                                                                                                                                                                                                                                                                                                             |
| `--tsconfig`           | `--tsconfig-override`      |                                                                                                                                                                                                                                                                                                                                                                         |
| `--version`            | n/a                        | Run `bun --version` to see the version of Bun.                                                                                                                                                                                                                                                                                                                          |

## JavaScript API

| esbuild.build()     | Bun.build()                | Notes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `absWorkingDir`     | n/a                        | Always set to `process.cwd()`                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `alias`             | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `allowOverwrite`    | n/a                        | Always false                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `assetNames`        | `naming.asset`             | Uses same templating syntax as esbuild, but `[ext]` must be included explicitly.<br /><br />`ts<br/>Bun.build({<br/>  entrypoints: ["./index.tsx"],<br/>  naming: {<br/>    asset: "[name].[ext]",<br/>  },<br/>});<br/>`                                                                                                                                                                                                                                                                |
| `banner`            | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `bundle`            | n/a                        | Always true. Use `Bun.Transpiler` to transpile without bundling.                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `charset`           | n/a                        | Not supported                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

From jarle/bun-skills, MIT.

More from jarle/bun-skills

Signals

Stars
9
Forks
1
Open issues
0
Last commit (this folder)
Feb 21, 2026 (8 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from jarle

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get Bun esbuild running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying Bun esbuild?

CallGet help
Cite this page

Bun esbuild skill. Agent Mart. https://agentmart.dev/skills/jarle-bun-esbuild (last updated 2026-10-24)