| 117 | } |
| 118 | |
| 119 | function getRoutingModulePath(host: Tree, modulePath: string): string | undefined { |
| 120 | const routingModulePath = |
| 121 | modulePath.endsWith(ROUTING_MODULE_EXT_LEGACY) || modulePath.endsWith(ROUTING_MODULE_EXT) |
| 122 | ? modulePath |
| 123 | : modulePath |
| 124 | .replace(MODULE_EXT_LEGACY, ROUTING_MODULE_EXT_LEGACY) |
| 125 | .replace(MODULE_EXT, ROUTING_MODULE_EXT); |
| 126 | |
| 127 | return host.exists(routingModulePath) ? routingModulePath : undefined; |
| 128 | } |
| 129 | |
| 130 | function buildRoute(options: ModuleOptions, modulePath: string) { |
| 131 | const relativeModulePath = buildRelativeModulePath(options, modulePath); |