@@ -62,7 +62,7 @@ MDX is a language thatβs compiled to JavaScript.
62
62
The easiest way to get started is to use an integration for your bundler if you
63
63
have one:
64
64
65
- * if you use ** esbuild** ,
65
+ * if you use ** esbuild** (or Bun) ,
66
66
install and configure [ ` @mdx-js/esbuild ` ] [ mdx-esbuild ]
67
67
* if you use ** Rollup** (or Vite),
68
68
install and configure [ ` @mdx-js/rollup ` ] [ mdx-rollup ]
@@ -234,6 +234,10 @@ etc.) you use.
234
234
To use more modern JavaScript features than what your users support,
235
235
[ configure esbuildβs ` target ` ] [ esbuild-target ] .
236
236
237
+ See also [ ΒΆ Bun] [ javascript-engines-bun ] ,
238
+ which you might be using,
239
+ for more info.
240
+
237
241
#### Rollup
238
242
239
243
<details >
@@ -798,6 +802,26 @@ MDX files can be imported in Node by using
798
802
[ ` @mdx-js/node-loader ` ] [ mdx-node-loader ] .
799
803
See its readme on how to configure it.
800
804
805
+ #### Bun
806
+
807
+ MDX files can be imported in [ Bun] [ ] by using
808
+ [ ` @mdx-js/esbuild ` ] [ mdx-esbuild ] .
809
+
810
+ <details >
811
+ <summary >Expand example</summary >
812
+
813
+ ``` toml path="bunfig.toml"
814
+ preload = [" ./bun-mdx.ts" ]
815
+ ```
816
+
817
+ ``` js twoslash path="bun-mdx.ts"
818
+ import {plugin } from ' bun'
819
+ import mdx from ' @mdx-js/esbuild'
820
+
821
+ plugin (mdx ())
822
+ ```
823
+ </details >
824
+
801
825
## Further reading
802
826
803
827
* If you want to use MDX content in your project,
@@ -911,6 +935,10 @@ See its readme on how to configure it.
911
935
912
936
[ build-system-vite ] : #vite
913
937
938
+ [ bun ] : https://bun.sh
939
+
940
+ [ javascript-engines-bun ] : #bun
941
+
914
942
[ bundler-esbuild ] : #esbuild
915
943
916
944
[ bundler-rollup ] : #rollup
0 commit comments