Skip to content

Commit 43c6861

Browse files
authored
fix(@ngtools/webpack): skip null files (#4168)
Fix #4165
1 parent 9d033e7 commit 43c6861

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: packages/@ngtools/webpack/src/compiler_host.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,12 @@ export class WebpackCompilerHost implements ts.CompilerHost {
148148
const isWindows = process.platform.startsWith('win');
149149
for (const fileName of Object.keys(this._files)) {
150150
const stats = this._files[fileName];
151-
// If we're on windows, we need to populate with the proper path separator.
152-
const path = isWindows ? fileName.replace(/\//g, '\\') : fileName;
153-
fs._statStorage.data[path] = [null, stats];
154-
fs._readFileStorage.data[path] = [null, stats.content];
151+
if (stats) {
152+
// If we're on windows, we need to populate with the proper path separator.
153+
const path = isWindows ? fileName.replace(/\//g, '\\') : fileName;
154+
fs._statStorage.data[path] = [null, stats];
155+
fs._readFileStorage.data[path] = [null, stats.content];
156+
}
155157
}
156158
for (const dirName of Object.keys(this._directories)) {
157159
const stats = this._directories[dirName];

0 commit comments

Comments
 (0)