@@ -594,18 +594,20 @@ export function ngcLoader(this: LoaderContext & { _compilation: any }, source: s
594594
595595 // NgFactory files depend on the component template, but we can't know what that file
596596 // 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).
598599 const ngFactoryRe = / \. n g f a c t o r y .j s $ / ;
599600 if ( ngFactoryRe . test ( sourceFileName ) ) {
600601 const originalFile = sourceFileName . replace ( ngFactoryRe , '.ts' ) ;
602+ this . addDependency ( originalFile ) ;
601603 const origDependencies = plugin . getDependencies ( originalFile ) ;
602604 origDependencies . forEach ( dep => this . addDependency ( dep ) ) ;
603605 }
604606
605607 // NgStyle files depend on the style file they represent.
606608 // E.g. `some-style.less.shim.ngstyle.js` depends on `some-style.less`.
607609 // 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 $ / ;
609611 if ( ngStyleRe . test ( sourceFileName ) ) {
610612 const styleFile = sourceFileName . replace ( ngStyleRe , '' ) ;
611613 const styleDependencies = plugin . getResourceDependencies ( styleFile ) ;
0 commit comments