File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -500,10 +500,14 @@ export class AngularCompilerPlugin {
500
500
const lazyRouteTSFile = discoveredLazyRoutes [ lazyRouteKey ] . replace ( / \\ / g, '/' ) ;
501
501
let modulePath : string , moduleKey : string ;
502
502
503
- if ( this . _JitMode ) {
503
+ if ( this . _JitMode ||
504
+ // When using Ivy and not using allowEmptyCodegenFiles, factories are not generated.
505
+ ( this . _compilerOptions . enableIvy && ! this . _compilerOptions . allowEmptyCodegenFiles )
506
+ ) {
504
507
modulePath = lazyRouteTSFile ;
505
508
moduleKey = `${ lazyRouteModule } ${ moduleName ? '#' + moduleName : '' } ` ;
506
509
} else {
510
+ // NgFactories are only used with AOT on ngc (legacy) mode.
507
511
modulePath = lazyRouteTSFile . replace ( / ( \. d ) ? \. t s x ? $ / , '' ) ;
508
512
modulePath += '.ngfactory.js' ;
509
513
const factoryModuleName = moduleName ? `#${ moduleName } NgFactory` : '' ;
You can’t perform that action at this time.
0 commit comments