Skip to Content
Fumadocs

Generate Types

Generate types without running dev/build server

Overview

You can run fumadocs-mdx to generate types & entry files (the .source folder) of the collections defined in source.config.ts. Collections of the Macro API need no generated files.

Optionally, you can run it in post install to ensure types are generated when initializing the project.

package.json
{
  "scripts": {
    "postinstall": "fumadocs-mdx"
  }
}

If your project uses a custom path for configuration file or output directory, you can provide them as command arguments:

npx fumadocs-mdx "config-path" "output-dir"
  • config-path: Fumadocs MDX config file, default to source.config.ts.
  • output-dir: Directory of generated files, default to .source.

How is this guide?

On this page