Skip to content

Commit

Permalink
Update index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Oct 1, 2024
1 parent e348fef commit 07fd814
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions docs/bundler/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ Each artifact also contains the following properties:
---

- `kind`
- What kind of build output this file is. A build generates bundled entrypoints, code-split "chunks", sourcemaps, and copied assets (like images).
- What kind of build output this file is. A build generates bundled entrypoints, code-split "chunks", sourcemaps, bytecode, and copied assets (like images).

---

Expand All @@ -1150,11 +1150,6 @@ Each artifact also contains the following properties:

---

- `bytecode`
- Generate bytecode for any JavaScript/TypeScript entrypoints. This can greatly improve startup times for large applications. Only supported for `"cjs"` format, only supports `"target": "bun"` and dependent on a matching version of Bun. This adds a corresponding `.jsc` file for each entrypoint

---

- `sourcemap`
- The sourcemap file corresponding to this file, if generated. Only defined for entrypoints and chunks.

Expand Down Expand Up @@ -1201,6 +1196,26 @@ BuildArtifact (entry-point) {

{% /codetabs %}

### Bytecode

The `bytecode: boolean` option can be used to generate bytecode for any JavaScript/TypeScript entrypoints. This can greatly improve startup times for large applications. Only supported for `"cjs"` format, only supports `"target": "bun"` and dependent on a matching version of Bun. This adds a corresponding `.jsc` file for each entrypoint.

{% codetabs %}

```ts#JavaScript
await Bun.build({
entrypoints: ["./index.tsx"],
outdir: "./out",
bytecode: true,
})
```

```bash#CLI
$ bun build ./index.tsx --outdir ./out --bytecode
```

{% /codetabs %}

### Executables

Bun supports "compiling" a JavaScript/TypeScript entrypoint into a standalone executable. This executable contains a copy of the Bun binary.
Expand Down

0 comments on commit 07fd814

Please sign in to comment.