diff --git a/packages/ngtools/webpack/src/angular_compiler_plugin.ts b/packages/ngtools/webpack/src/angular_compiler_plugin.ts index 13415446ed13..6891427808e5 100644 --- a/packages/ngtools/webpack/src/angular_compiler_plugin.ts +++ b/packages/ngtools/webpack/src/angular_compiler_plugin.ts @@ -1258,8 +1258,10 @@ export class AngularCompilerPlugin { if (!this._resourceLoader) { return []; } + // The source loader uses TS-style forward slash paths for all platforms. + const resolvedFileName = forwardSlashPath(fileName); - return this._resourceLoader.getResourceDependencies(fileName); + return this._resourceLoader.getResourceDependencies(resolvedFileName); } // This code mostly comes from `performCompilation` in `@angular/compiler-cli`.