diff --git a/packages/@ngtools/webpack/src/compiler_host.ts b/packages/@ngtools/webpack/src/compiler_host.ts index 7c56c50fcfe4..e0b4fc05ce7f 100644 --- a/packages/@ngtools/webpack/src/compiler_host.ts +++ b/packages/@ngtools/webpack/src/compiler_host.ts @@ -188,7 +188,8 @@ export class WebpackCompilerHost implements ts.CompilerHost { invalidate(fileName: string): void { fileName = this._resolve(fileName); - if (fileName in this._files) { + const result = this.readFile(fileName); + if (!result) { this._files[fileName] = null; this._changedFiles[fileName] = true; }