diff --git a/ts2panda/src/index.ts b/ts2panda/src/index.ts index bc5881e33ab81b1c8ef67c4157b96470cef27dc6..adabde37120be1ac20c5b92c2d20476634865bcc 100644 --- a/ts2panda/src/index.ts +++ b/ts2panda/src/index.ts @@ -57,7 +57,8 @@ function main(fileNames: string[], options: ts.CompilerOptions) { if (CmdOptions.needRecordDtsType()) { for (let sourceFile of program.getSourceFiles()) { - if (sourceFile.isDeclarationFile && !program.isSourceFileDefaultLibrary(sourceFile)) { + let originFileNames = new Set(fileNames.slice(0, fileNames.length - dtsFiles.length)); + if (sourceFile.isDeclarationFile && !program.isSourceFileDefaultLibrary(sourceFile) && originFileNames.has(sourceFile.fileName)) { setGlobalDeclare(checkIsGlobalDeclaration(sourceFile)); generateDTs(sourceFile, options); }