Skip to content

Commit

Permalink
fix(@ngtools/webpack): support invalidating compiler-host with a dire…
Browse files Browse the repository at this point in the history
…ctory
  • Loading branch information
clydin authored and hansl committed Mar 18, 2018
1 parent 935060c commit 6d0e971
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions packages/@ngtools/webpack/src/compiler_host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,20 @@ export class WebpackCompilerHost implements ts.CompilerHost {
.map((path) => this.denormalizePath(path));
}

invalidate(fileName: string): void {
fileName = this.resolve(fileName);
if (fileName in this._files) {
this._files[fileName] = null;
invalidate(path: string): void {
const fullPath = this.resolve(path);
if (fullPath in this._files) {
this._files[fullPath] = null;
} else {
for (const file in this._files) {
if (file.startsWith(fullPath + '/')) {
this._files[file] = null;
}
}
}
if (this.fileExists(fullPath)) {
this._changedFiles[fullPath] = true;
}
this._changedFiles[fileName] = true;
}

fileExists(fileName: string, delegate = true): boolean {
Expand Down

0 comments on commit 6d0e971

Please sign in to comment.