Fumadocs

生成类型

在不运行开发/构建服务器的情况下生成类型

概览

🌐 Overview

你可以运行 fumadocs-mdx 来生成类型和入口文件(.source 文件夹)。

🌐 You can run fumadocs-mdx to generate types & entry files (the .source folder).

可选择在安装后运行它,以确保在初始化项目时生成类型。

🌐 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 配置文件,默认为 source.config.ts
  • output-dir:生成文件的目录,默认为 .source

Last updated on

On this page