diff --git a/packages/remix-routes/src/__tests__/__snapshots__/cli.test.ts.snap b/packages/remix-routes/src/__tests__/__snapshots__/cli.test.ts.snap index d57b2ce3..8cea493a 100644 --- a/packages/remix-routes/src/__tests__/__snapshots__/cli.test.ts.snap +++ b/packages/remix-routes/src/__tests__/__snapshots__/cli.test.ts.snap @@ -214,6 +214,7 @@ exports[`build customPaths routes 1`] = ` >; export type RouteId = + | 'root' | 'routes/($lang).about' | 'routes/admin' | 'routes/admin._index' @@ -469,6 +470,7 @@ exports[`build v1 routes 1`] = ` >; export type RouteId = + | 'root' | 'routes/($lang)/about' | 'routes/admin' | 'routes/admin/episodes/$id' @@ -732,6 +734,7 @@ exports[`build v2 routes 1`] = ` >; export type RouteId = + | 'root' | 'routes/($lang).about' | 'routes/admin' | 'routes/admin._index' diff --git a/packages/remix-routes/src/cli.ts b/packages/remix-routes/src/cli.ts index 45227c4c..1ab5d0af 100644 --- a/packages/remix-routes/src/cli.ts +++ b/packages/remix-routes/src/cli.ts @@ -69,6 +69,7 @@ async function buildHelpers(config: RemixConfig): Promise<[RoutesInfo, string[]] ); routes.forEach((route) => { let currentPath = parentPath; + routeIds.push(route.id); if (route.id === 'root') { routesInfo['/'] = { fileName: route.file, @@ -85,7 +86,6 @@ async function buildHelpers(config: RemixConfig): Promise<[RoutesInfo, string[]] fileName: route.file, params: paramsNames }; - routeIds.push(route.id); } handleRoutesRecursive(route.id, currentPath); });