@@ -568,7 +568,6 @@ export function ngcLoader(this: LoaderContext & { _compilation: any }, source: s
568
568
. then ( ( ) => {
569
569
timeEnd ( timeLabel + '.ngcLoader.AngularCompilerPlugin' ) ;
570
570
const result = plugin . getFile ( sourceFileName ) ;
571
- const dependencies = plugin . getDependencies ( sourceFileName ) ;
572
571
573
572
if ( result . sourceMap ) {
574
573
// Process sourcemaps for Webpack.
@@ -585,7 +584,10 @@ export function ngcLoader(this: LoaderContext & { _compilation: any }, source: s
585
584
throw new Error ( 'TypeScript compilation failed.' ) ;
586
585
}
587
586
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
+
589
591
cb ( null , result . outputText , result . sourceMap ) ;
590
592
} )
591
593
. catch ( err => {
@@ -646,8 +648,9 @@ export function ngcLoader(this: LoaderContext & { _compilation: any }, source: s
646
648
_getResourcesUrls ( refactor ) . forEach ( ( url : string ) => {
647
649
this . addDependency ( path . resolve ( path . dirname ( sourceFileName ) , url ) ) ;
648
650
} ) ;
651
+ // Dependencies must use system path separator.
649
652
_getImports ( refactor , compilerOptions , plugin . compilerHost , plugin . moduleResolutionCache )
650
- . forEach ( ( importString : string ) => this . addDependency ( importString ) ) ;
653
+ . forEach ( ( dep ) => this . addDependency ( dep . replace ( / \/ / g , path . sep ) ) ) ;
651
654
timeEnd ( timeLabel + '.ngcLoader.AotPlugin.addDependency' ) ;
652
655
} )
653
656
. then ( ( ) => {
0 commit comments