@@ -568,7 +568,6 @@ export function ngcLoader(this: LoaderContext & { _compilation: any }, source: s
568568 . then ( ( ) => {
569569 timeEnd ( timeLabel + '.ngcLoader.AngularCompilerPlugin' ) ;
570570 const result = plugin . getFile ( sourceFileName ) ;
571- const dependencies = plugin . getDependencies ( sourceFileName ) ;
572571
573572 if ( result . sourceMap ) {
574573 // Process sourcemaps for Webpack.
@@ -585,7 +584,10 @@ export function ngcLoader(this: LoaderContext & { _compilation: any }, source: s
585584 throw new Error ( 'TypeScript compilation failed.' ) ;
586585 }
587586
588- dependencies . forEach ( dep => this . addDependency ( dep ) ) ;
587+ // Dependencies must use system path separator.
588+ const dependencies = plugin . getDependencies ( sourceFileName ) ;
589+ dependencies . forEach ( dep => this . addDependency ( dep . replace ( / \/ / g, path . sep ) ) ) ;
590+
589591 cb ( null , result . outputText , result . sourceMap ) ;
590592 } )
591593 . catch ( err => {
@@ -646,8 +648,9 @@ export function ngcLoader(this: LoaderContext & { _compilation: any }, source: s
646648 _getResourcesUrls ( refactor ) . forEach ( ( url : string ) => {
647649 this . addDependency ( path . resolve ( path . dirname ( sourceFileName ) , url ) ) ;
648650 } ) ;
651+ // Dependencies must use system path separator.
649652 _getImports ( refactor , compilerOptions , plugin . compilerHost , plugin . moduleResolutionCache )
650- . forEach ( ( importString : string ) => this . addDependency ( importString ) ) ;
653+ . forEach ( ( dep ) => this . addDependency ( dep . replace ( / \/ / g , path . sep ) ) ) ;
651654 timeEnd ( timeLabel + '.ngcLoader.AotPlugin.addDependency' ) ;
652655 } )
653656 . then ( ( ) => {
0 commit comments