简体   繁体   中英

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

I've got the next question about TypeDoc. So I have got a TypeDoc config like that:

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. After recompiled those files the *.d.ts files had been created and I want to exclude it.

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/FolderB/ (there are a few *.ts files, for example: fileB.ts)
  • MyApp/Scripts/FolderC/ (there are a few *.ts files, for example: fileC.ts)

Now my TypeDoc config is excluding all *.d.ts files from full of app.

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:

  1. exclude: 'Scripts/{FolderA,FolderB,FolderC}/*.d.ts' but it is just ignoring
  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.
  3. exclude: '**/{FolderA,FolderB,FolderC}/*.d.ts' but it is just ignoring too
  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? 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 . 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.

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


It was a piece of cake - I need to add into src line: 'node_modules/*/index.d.ts'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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