Bun
Access content in Bun.
Setup
Register the plugin in preload script:
bunfig.toml
scripts/preload.ts
preload = ["./scripts/preload.ts"]import { createMdxPlugin } from '@hanzo/docs/mdx/bun';
Bun.plugin(createMdxPlugin());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.
Next.js
Vite
import { postInstall } from '@hanzo/docs/mdx/next';
await postInstall({ configPath: 'source.config.ts' });import { postInstall } from '@hanzo/docs/mdx/vite';
await postInstall({
configPath: 'source.config.ts',
index: {
target: 'bun',
},
});How is this guide?
