@@ -589,7 +589,10 @@ export function ngcLoader(this: LoaderContext & { _compilation: any }, source: s
589589 if ( sourceFileName . endsWith ( '.ts' ) ) {
590590 result . errorDependencies . forEach ( dep => this . addDependency ( dep ) ) ;
591591 const dependencies = plugin . getDependencies ( sourceFileName ) ;
592- dependencies . forEach ( dep => this . addDependency ( dep ) ) ;
592+ dependencies . forEach ( dep => {
593+ plugin . updateChangedFileExtensions ( path . extname ( dep ) ) ;
594+ this . addDependency ( dep ) ;
595+ } ) ;
593596 }
594597
595598 // NgFactory files depend on the component template, but we can't know what that file
@@ -601,7 +604,10 @@ export function ngcLoader(this: LoaderContext & { _compilation: any }, source: s
601604 const originalFile = sourceFileName . replace ( ngFactoryRe , '.ts' ) ;
602605 this . addDependency ( originalFile ) ;
603606 const origDependencies = plugin . getDependencies ( originalFile ) ;
604- origDependencies . forEach ( dep => this . addDependency ( dep ) ) ;
607+ origDependencies . forEach ( dep => {
608+ plugin . updateChangedFileExtensions ( path . extname ( dep ) ) ;
609+ this . addDependency ( dep ) ;
610+ } ) ;
605611 }
606612
607613 // NgStyle files depend on the style file they represent.
@@ -611,7 +617,10 @@ export function ngcLoader(this: LoaderContext & { _compilation: any }, source: s
611617 if ( ngStyleRe . test ( sourceFileName ) ) {
612618 const styleFile = sourceFileName . replace ( ngStyleRe , '' ) ;
613619 const styleDependencies = plugin . getResourceDependencies ( styleFile ) ;
614- styleDependencies . forEach ( dep => this . addDependency ( dep ) ) ;
620+ styleDependencies . forEach ( dep => {
621+ plugin . updateChangedFileExtensions ( path . extname ( dep ) ) ;
622+ this . addDependency ( dep ) ;
623+ } ) ;
615624 }
616625
617626 timeEnd ( timeLabel ) ;
0 commit comments