Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/bundler/esbuild.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ In Bun's CLI, boolean flags like `--minify` take no argument. Flags that take on
| `--loader:.ext=loader` | `--loader .ext:loader` | Bun supports a different set of built-in loaders than esbuild; see [loaders](/bundler/loaders). The esbuild loaders `dataurl`, `binary`, `base64`, `copy`, and `empty` are not implemented.<br/><br/>The syntax for `--loader` differs.<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 |
| `--outfile` | `--outfile` | Writes one file. When the build also emits a second file (an asset, a CSS file, or an external source map), it fails: use `--outdir`. esbuild writes the second file next to the outfile. When `--outdir` is also set, Bun ignores `--outfile`. esbuild reports an error. |
| `--packages` | `--packages` | No differences |
| `--platform` | `--target` | Renamed to `--target` for consistency with tsconfig. Does not support `neutral`. |
| `--serve` | n/a | Not applicable |
Expand Down Expand Up @@ -121,7 +121,7 @@ In Bun's CLI, boolean flags like `--minify` take no argument. Flags that take on
| `drop` | `drop` | |
| `entryNames` | `naming` or `naming.entry` | Bun supports a `naming` key that can either be a string or an object. Uses the same templating syntax as esbuild, but you must include `[ext]` explicitly.<br/><br/>`ts<br/>Bun.build({<br/> entrypoints: ["./index.tsx"],<br/> // when string, this is equivalent to entryNames<br/> naming: "[name].[ext]",<br/><br/> // granular naming options<br/> naming: {<br/> entry: "[name].[ext]",<br/> asset: "[name].[ext]",<br/> chunk: "[name].[ext]",<br/> },<br/>});<br/>` |
| `entryPoints` | `entrypoints` | Capitalization difference |
| `external` | `external` | No differences |
| `external` | `external` | A `*` pattern matches the import path as written. esbuild also matches a pattern that starts with `./`, `../`, or `/` against the path of the imported file, so `./lib/*` there also covers `../lib/a` imported from `src/`. A path without `*` is compared before Bun resolves the import to a file: `./lib/a.ts` does not match `import "./lib/a"`. Bun keeps a matched import path as written. esbuild rewrites one that it matched by file path relative to the output directory. |
| `footer` | `footer` | Only applies to js bundles |
| `format` | `format` | Supports `"esm"`, `"cjs"`, and `"iife"`. |
| `globalName` | n/a | Not supported |
Expand Down
Loading