fix(compiler): allow to use flat modules and summaries

The combination of flat modules, flat module redirects and summaries
lead to errors before.
This commit is contained in:
Tobias Bosch
2017-09-28 09:39:16 -07:00
committed by Victor Berchet
parent 14e8e88022
commit ec2be5dccb
8 changed files with 147 additions and 96 deletions

View File

@ -406,7 +406,7 @@ export class MockSummaryResolver implements SummaryResolver<StaticSymbol> {
const entry = this.importAs.find(entry => entry.symbol === symbol);
return entry ? entry.importAs : undefined !;
}
getKnownModuleName(fileName: string): string|null { return null; }
isLibraryFile(filePath: string): boolean { return filePath.endsWith('.d.ts'); }
toSummaryFileName(filePath: string): string { return filePath.replace(/(\.d)?\.ts$/, '.d.ts'); }
fromSummaryFileName(filePath: string): string { return filePath; }