简体   繁体   English

TypeDoc以及如何仅从几个路径中排除* .d.ts文件

[英]TypeDoc and how to exclude *.d.ts files only from few paths

I've got the next question about TypeDoc. 我有关于TypeDoc的下一个问题。 So I have got a TypeDoc config like that: 所以我有一个像这样的TypeDoc配置:

typedoc: {
    build: {
        options: {
            module: 'commonjs',
            out: '../MyDocumentation/',
            name: 'MyApp',
            target: 'es5',
            exclude: '**/*/*.d.ts',
            excludePrivate: true,
            mode: 'file'
        },
        src: [
            ...some sources...
        ]
    }
}

On my app are a few paths with *.ts files. 在我的应用程序上有一些带有* .ts文件的路径。 After recompiled those files the *.d.ts files had been created and I want to exclude it. 重新编译这些文件后,*。d.ts文件已创建,我想排除它。

So for needs of this question we'll assume that my paths looks like that: 因此,对于这个问题的需要,我们将假定我的路径如下所示:

  • MyApp/Scripts/FolderA/ (there are a few *.ts files, for example: fileA.ts) MyApp / Scripts / FolderA /(有一些* .ts文件,例如:fileA.ts)
  • MyApp/Scripts/FolderB/ (there are a few *.ts files, for example: fileB.ts) MyApp / Scripts / FolderB /(有一些* .ts文件,例如:fileB.ts)
  • MyApp/Scripts/FolderC/ (there are a few *.ts files, for example: fileC.ts) MyApp / Scripts / FolderC /(有一些* .ts文件,例如:fileC.ts)

Now my TypeDoc config is excluding all *.d.ts files from full of app. 现在,我的TypeDoc配置从整个应用程序中排除了所有* .d.ts文件。

I'm trying to exclude *.d.ts files but only from a my defined paths so I was trying a few ways to define my exclude pattern: 我试图排除* .d.ts文件,但仅从我定义的路径排除,因此我尝试了几种方法来定义排除模式:

  1. exclude: 'Scripts/{FolderA,FolderB,FolderC}/*.d.ts' but it is just ignoring exclude: 'Scripts/{FolderA,FolderB,FolderC}/*.d.ts'但它只是忽略
  2. exclude: '**/*+(FolderA|FolderB|FolderC)/*.d.ts' but I've got a Process terminated with code 3. 'FolderB' is not recognized as an internal or external command, operable program or batch file error. exclude: '**/*+(FolderA|FolderB|FolderC)/*.d.ts'但是我的Process terminated with code 3. 'FolderB' is not recognized as an internal or external command, operable program or batch file exclude: '**/*+(FolderA|FolderB|FolderC)/*.d.ts' Process terminated with code 3. 'FolderB' is not recognized as an internal or external command, operable program or batch file错误。
  3. exclude: '**/{FolderA,FolderB,FolderC}/*.d.ts' but it is just ignoring too exclude: '**/{FolderA,FolderB,FolderC}/*.d.ts'但它也忽略了
  4.  exclude: [ 'Scripts/FolderA/*.d.ts', 'Scripts/FolderB/*.d.ts', 'Scripts/FolderC/*.d.ts' ] 

    but it are ignoring too... 但它也忽略了...

  5. **/FolderA/*.d.ts is not ignoring but how to add a few path? **/FolderA/*.d.ts不是忽略,而是如何添加一些路径? Some of my path have a subfolders, ex. 我的某些路径有一个子文件夹,例如。 **/FolderA/ver1/*.d.ts

And that's all because I need to include to my documentation all index.d.ts files from node_modules . 这就是所有这些,因为我需要将来自node_modules所有index.d.ts文件包括到我的文档中。 I need to reference to those libs. 我需要参考这些库。

Maybe there is another way how to do it? 也许还有另一种方法怎么做?

I saw this comment but I don't know why - my typedoc recompiling task is ignoring that pattern. 我看到了此评论,但不知道为什么-我的typedoc重新编译任务正在忽略该模式。

Ok, I found answer by myself...again ! 好的,我自己找到答案...再次!

I need something like that: 我需要这样的东西:

exclude: [
    '**/FolderA/*.d.ts',
    '**/FolderA/ver1/*.d.ts',
    '**/FolderB/*.d.ts',
    '**/FolderC/*.d.ts'
]

now I have to way how to include only index.d.ts files from node_module :D 现在我必须设法仅包括来自node_module index.d.ts文件:D


It was a piece of cake - I need to add into src line: 'node_modules/*/index.d.ts' 这真是小菜一碟-我需要在src行中添加: 'node_modules/*/index.d.ts'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM