fix(compiler): avoid emitting self importing factories

Fixes: #17389
This commit is contained in:
Chuck Jazdzewski
2017-06-21 15:05:11 -07:00
committed by Hans
parent 34cc3f2982
commit 4352dd27c4
4 changed files with 36 additions and 5 deletions

View File

@ -110,7 +110,7 @@ export class CompilerHost implements AotCompilerHost {
fileNameToModuleName(importedFile: string, containingFile: string): string {
// If a file does not yet exist (because we compile it later), we still need to
// assume it exists it so that the `resolve` method works!
if (!this.context.fileExists(importedFile)) {
if (importedFile !== containingFile && !this.context.fileExists(importedFile)) {
this.context.assumeFileExists(importedFile);
}