Fumadocs

Bun

Access content in Bun.

Setup

Register the plugin in preload script:

preload = ["./scripts/preload.ts"]

It will add support for loading MDX/meta files on runtime.

Now running any script with Bun, you can access your content files directly.

Re-generate .source folder

Optionally, you can re-generate the .source folder.

It is useful when the folder could be missing, or you are using Vite, which defaults to generating code with Vite-specific APIs.

preload.ts
import { postInstall } from 'fumadocs-mdx/next';

await postInstall({ configPath: 'source.config.ts' });

How is this guide?

Last updated on