@@ -594,18 +594,20 @@ export function ngcLoader(this: LoaderContext & { _compilation: any }, source: s
594
594
595
595
// NgFactory files depend on the component template, but we can't know what that file
596
596
// is (if any). So we add all the dependencies that the original component file has
597
- // to the factory as well, which includes html and css templates.
597
+ // to the factory as well, which includes html and css templates, and the component
598
+ // itself (for inline html/templates templates).
598
599
const ngFactoryRe = / \. n g f a c t o r y .j s $ / ;
599
600
if ( ngFactoryRe . test ( sourceFileName ) ) {
600
601
const originalFile = sourceFileName . replace ( ngFactoryRe , '.ts' ) ;
602
+ this . addDependency ( originalFile ) ;
601
603
const origDependencies = plugin . getDependencies ( originalFile ) ;
602
604
origDependencies . forEach ( dep => this . addDependency ( dep ) ) ;
603
605
}
604
606
605
607
// NgStyle files depend on the style file they represent.
606
608
// E.g. `some-style.less.shim.ngstyle.js` depends on `some-style.less`.
607
609
// Those files can in turn depend on others, so we have to add them all.
608
- const ngStyleRe = / \. s h i m \. n g s t y l e \. j s $ / ;
610
+ const ngStyleRe = / (?: \. s h i m ) ? \. n g s t y l e \. j s $ / ;
609
611
if ( ngStyleRe . test ( sourceFileName ) ) {
610
612
const styleFile = sourceFileName . replace ( ngStyleRe , '' ) ;
611
613
const styleDependencies = plugin . getResourceDependencies ( styleFile ) ;
0 commit comments