Skip to content

Commit

Permalink
fix: add mappings for ngfactory & ngsummary files to their module nam…
Browse files Browse the repository at this point in the history
…es in aot summary resolver (#25335)

PR Close #25335
  • Loading branch information
gregmagolan authored and kara committed Aug 7, 2018
1 parent 7bf5a43 commit 02e201a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/compiler/src/aot/summary_resolver.ts
Expand Up @@ -120,6 +120,16 @@ export class AotSummaryResolver implements SummaryResolver<StaticSymbol> {
summaries.forEach((summary) => this.summaryCache.set(summary.symbol, summary));
if (moduleName) {
this.knownFileNameToModuleNames.set(filePath, moduleName);
if (filePath.endsWith('.d.ts')) {
// Also add entries to map the ngfactory & ngsummary files to their module names.
// This is necessary to resolve ngfactory & ngsummary files to their AMD module
// names when building angular with Bazel from source downstream.
// See https://github.com/bazelbuild/rules_typescript/pull/223 for context.
this.knownFileNameToModuleNames.set(
filePath.replace(/\.d\.ts$/, '.ngfactory.d.ts'), moduleName + '.ngfactory');
this.knownFileNameToModuleNames.set(
filePath.replace(/\.d\.ts$/, '.ngsummary.d.ts'), moduleName + '.ngsummary');
}
}
importAs.forEach((importAs) => { this.importAs.set(importAs.symbol, importAs.importAs); });
}
Expand Down

0 comments on commit 02e201a

Please sign in to comment.