Fumadocs

Bun

在 Bun 中访问内容。

安装

🌐 Setup

在预加载脚本中注册插件:

🌐 Register the plugin in preload script:

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

它将增加在运行时加载 MDX/元文件的支持。

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

现在使用 Bun 运行任何脚本,你可以直接访问你的内容文件。

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

重新生成 .source 文件夹

🌐 Re-generate .source folder

可选择重新生成 .source 文件夹。

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

当文件夹可能不存在,或者你正在使用 Vite(它默认生成带有 Vite 特定 API 的代码)时,这非常有用。

🌐 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' });

Last updated on

On this page