diff --git a/packages/ngtools/webpack/src/ivy/plugin.ts b/packages/ngtools/webpack/src/ivy/plugin.ts index eee83529b6fa..b64cb689de4e 100644 --- a/packages/ngtools/webpack/src/ivy/plugin.ts +++ b/packages/ngtools/webpack/src/ivy/plugin.ts @@ -266,8 +266,9 @@ export class AngularWebpackPlugin { continue; } - // Ensure all program files are considered part of the compilation and will be watched - compilation.fileDependencies.add(sourceFile.fileName); + // Ensure all program files are considered part of the compilation and will be watched. + // Webpack does not normalize paths. Therefore, we need to normalize the path with FS seperators. + compilation.fileDependencies.add(externalizePath(sourceFile.fileName)); // Add all non-declaration files to the initial set of unused files. The set will be // analyzed and pruned after all Webpack modules are finished building.