Skip to content

Commit

Permalink
fix(angular): consider app-routing.module.ts when setting up module f…
Browse files Browse the repository at this point in the history
…ederation host routes (#16285)

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
  • Loading branch information
aliataf and leosvelperez committed Apr 14, 2023
1 parent f76dd6e commit 3e45445
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,20 @@ export function updateHostAppRoutes(tree: Tree, options: Schema) {
`
);

const pathToHostRootRoutingFile = joinPathFragments(
let pathToHostRootRoutingFile = joinPathFragments(
sourceRoot,
'app/app.routes.ts'
);

const hostRootRoutingFile = tree.read(pathToHostRootRoutingFile, 'utf-8');
let hostRootRoutingFile = tree.read(pathToHostRootRoutingFile, 'utf-8');

if (!hostRootRoutingFile) {
pathToHostRootRoutingFile = joinPathFragments(
sourceRoot,
'app/app-routing.module.ts'
);
hostRootRoutingFile = tree.read(pathToHostRootRoutingFile, 'utf-8');
}

let sourceFile = tsModule.createSourceFile(
pathToHostRootRoutingFile,
Expand Down

0 comments on commit 3e45445

Please sign in to comment.