Skip to content

Commit

Permalink
Add Bun section to Getting started
Browse files Browse the repository at this point in the history
Closes GH-2517.

Reviewed-by: Remco Haszing <[email protected]>
Reviewed-by: Christian Murphy <[email protected]>
Reviewed-by: Titus Wormer <[email protected]>
  • Loading branch information
karlhorky committed Jul 23, 2024
1 parent 07d5e2f commit 37318de
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion docs/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ MDX is a language that’s compiled to JavaScript.
The easiest way to get started is to use an integration for your bundler if you
have one:

* if you use **esbuild**,
* if you use **esbuild** (or Bun),
install and configure [`@mdx-js/esbuild`][mdx-esbuild]
* if you use **Rollup** (or Vite),
install and configure [`@mdx-js/rollup`][mdx-rollup]
Expand Down Expand Up @@ -234,6 +234,10 @@ etc.) you use.
To use more modern JavaScript features than what your users support,
[configure esbuild’s `target`][esbuild-target].

See also [¶ Bun][javascript-engines-bun],
which you might be using,
for more info.

#### Rollup

<details>
Expand Down Expand Up @@ -798,6 +802,26 @@ MDX files can be imported in Node by using
[`@mdx-js/node-loader`][mdx-node-loader].
See its readme on how to configure it.
#### Bun
MDX files can be imported in [Bun][] by using
[`@mdx-js/esbuild`][mdx-esbuild].
<details>
<summary>Expand example</summary>
```toml path="bunfig.toml"
preload = ["./bun-mdx.ts"]
```
```js twoslash path="bun-mdx.ts"
import {plugin} from 'bun'
import mdx from '@mdx-js/esbuild'
plugin(mdx())
```
</details>
## Further reading
* If you want to use MDX content in your project,
Expand Down Expand Up @@ -911,6 +935,10 @@ See its readme on how to configure it.
[build-system-vite]: #vite
[bun]: https://bun.sh
[javascript-engines-bun]: #bun
[bundler-esbuild]: #esbuild
[bundler-rollup]: #rollup
Expand Down

0 comments on commit 37318de

Please sign in to comment.