TypeDoc 来自一个项目的一些文档

TypeDoc a few documentations from one project

我必须使用 TypeDoc 来准备我的项目文档。

在我的项目中,我有几个带有 TS 文件的文件夹(彼此不相关),例如。文件夹 A、文件夹 B 等

当我只想要一个或多个文件夹中的一个文档时,我非常简单,但我很难为每个文件夹生成单独的文档。

对于一个文件夹,我的配置文件如下所示:

typedoc: {
    build: {
        options: {
            module: 'commonjs',
            out: '../Documentation/A',
            name: 'Documentation for A folder',
            target: 'es5',
            exclude: '**/*.d.ts',
            excludePrivate: true,
            mode: 'file'
        },
        src: [
            'js/A/*.ts'
        ]
    }
}

如果我想为每个文件夹创建单独的文档,我不知道应该如何构建此配置。

我尝试了类似的构建数组(但没有成功):

typedoc: {
    build: [{
        options: {
            module: 'commonjs',
            out: '../Documentation/A',
            name: 'Documentation for A folder',
            target: 'es5',
            exclude: '**/*.d.ts',
            excludePrivate: true,
            mode: 'file'
        },
        src: [
            'js/A/*.ts'
        ]
    },
    {
        options: {
            module: 'commonjs',
            out: '../Documentation/B',
            name: 'Documentation for B folder',
            target: 'es5',
            exclude: '**/*.d.ts',
            excludePrivate: true,
            mode: 'file'
        },
        src: [
            'js/B/*.ts'
        ]
    }]
}

有什么想法吗?

好的,我自己解决了我的问题。 当我需要一些构建时,我应该像这样创建我的配置文件:

typedoc: {
    buildA: {
        options: {
            module: 'commonjs',
            out: '../Documentation/A',
            name: 'Documentation for A folder',
            target: 'es5',
            exclude: '**/*.d.ts',
            excludePrivate: true,
            mode: 'file'
        },
        src: [
            'js/A/*.ts'
        ]
    },
    buildB: {
        options: {
            module: 'commonjs',
            out: '../Documentation/B',
            name: 'Documentation for B folder',
            target: 'es5',
            exclude: '**/*.d.ts',
            excludePrivate: true,
            mode: 'file'
        },
        src: [
            'js/B/*.ts'
        ]
    }
}

我应该这样称呼它:

typedoc:buildA

typedoc:buildB

就这些了:)