Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): update copy-webpack-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva authored and alexeagle committed Oct 19, 2018
1 parent 231b62e commit a6ffa2b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"autoprefixer": "8.4.1",
"circular-dependency-plugin": "5.0.2",
"clean-css": "4.2.1",
"copy-webpack-plugin": "4.5.2",
"copy-webpack-plugin": "4.5.3",
"file-loader": "2.0.0",
"glob": "7.1.3",
"istanbul": "0.4.5",
Expand Down
26 changes: 15 additions & 11 deletions packages/ngtools/webpack/src/compiler_host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,25 @@ export class WebpackCompilerHost implements ts.CompilerHost {
const fullPath = this.resolve(fileName);
this._sourceFileCache.delete(fullPath);

let exists = false;
try {
const exists = this._syncHost.isFile(fullPath);
exists = this._syncHost.isFile(fullPath);
if (exists) {
this._changedFiles.add(fullPath);
}
} catch {
// File doesn't exist anymore, so we should delete the related virtual files.
if (fullPath.endsWith('.ts')) {
this._virtualFileExtensions.forEach(ext => {
const virtualFile = fullPath.replace(/\.ts$/, ext) as Path;
if (this._memoryHost.exists(virtualFile)) {
this._memoryHost.delete(virtualFile);
}
});
}
} catch { }

// File doesn't exist anymore and is not a factory, so we should delete the related
// virtual files.
if (!exists && fullPath.endsWith('.ts') && !(
fullPath.endsWith('.ngfactory.ts') || fullPath.endsWith('.shim.ngstyle.ts')
)) {
this._virtualFileExtensions.forEach(ext => {
const virtualFile = (fullPath.slice(0, -3) + ext) as Path;
if (this._memoryHost.exists(virtualFile)) {
this._memoryHost.delete(virtualFile);
}
});
}
}

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2285,10 +2285,10 @@ copy-descriptor@^0.1.0:
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=

copy-webpack-plugin@4.5.2:
version "4.5.2"
resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-4.5.2.tgz#d53444a8fea2912d806e78937390ddd7e632ee5c"
integrity sha512-zmC33E8FFSq3AbflTvqvPvBo621H36Afsxlui91d+QyZxPIuXghfnTsa1CuqiAaCPgJoSUWfTFbKJnadZpKEbQ==
copy-webpack-plugin@4.5.3:
version "4.5.3"
resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-4.5.3.tgz#14a224d205e46f7a79f7956028e1da6df2225ff2"
integrity sha512-VKCiNXQcc8zyznaepXfKpCH2cZD+/j3T3B+gsFY97P7qMlEsj34wr/sI9OCG7QPUUh7gAHVx3q8Q1rdQIDM4bA==
dependencies:
cacache "^10.0.4"
find-cache-dir "^1.0.0"
Expand Down

0 comments on commit a6ffa2b

Please sign in to comment.