我们的Storybook项目中已经包含TypeDoc,它可用于我们自己的组件。我们还希望为通用Material组件生成TypeDocs。
我已经在Typedoc的--exclude
参数中摆弄了很多东西,但是不知怎么使它无法正常工作。
到目前为止,package.json中的条目如下所示:
"typedoc": "typedoc --mode modules --exclude **/*.spec.ts* --out build/typedoc --json build/typedoc/typedoc.json projects/"
我尝试通过在语句中添加--includeDeclarations
并修改--exclude
模式,以排除node_modules
之外node_modules/@angular/material
下的所有内容,但至今无济于事。
例如,我尝试了以下模式:
**/{node_modules/!(@angular/material)/**,*.spec.ts}
但是我总是会收到类似的错误
"/**" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
到目前为止,我从未使用过minimatch或typedoc,因此非常感谢您的帮助。
有什么想法吗?
我能够通过在与typedoc.json
相同的目录中创建一个package.json
文件来解决此问题。现在,typedoc脚本为:
"typedoc --options ./typedoc.json projects/"
,typedoc.json
的内容为:
{
"out": "build/typedoc",
"json": "build/typedoc/typedoc.json",
"mode": "modules",
"includeDeclarations": true,
"exclude": [
"**/*.spec.ts",
"**/node_modules/!(@angular)/**",
"**/node_modules/@angular/!(material)/**"
]
}
行为符合预期。