Skip to content

Commit b7f8581

Browse files
Adol1111jasonaden
authored andcommitted
fix(compiler-cli): import routing module with forRoot (#16438)
1 parent a5bdbed commit b7f8581

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/compiler-cli/src/ngtools_impl.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,13 @@ function _extractLazyRoutesFromStaticModule(
149149
return acc;
150150
}, []);
151151

152-
const importedSymbols = ((moduleMetadata.imports || []) as any[])
153-
.filter(i => i instanceof StaticSymbol) as StaticSymbol[];
152+
const importedSymbols =
153+
((moduleMetadata.imports || []) as any[])
154+
.filter(i => i instanceof StaticSymbol || i.ngModule instanceof StaticSymbol)
155+
.map(i => {
156+
if (i instanceof StaticSymbol) return i;
157+
return i.ngModule;
158+
}) as StaticSymbol[];
154159

155160
return importedSymbols
156161
.reduce(

0 commit comments

Comments
 (0)