Skip to content

Commit 315e51a

Browse files
authored
Merge pull request #12072 from remix-run/pedro/fix-typegen-for-async-route-config
fix typegen for async route config
2 parents de54f08 + 0534442 commit 315e51a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/react-router-dev/typescript/typegen.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import dedent from "dedent";
55
import * as Path from "pathe";
66
import * as Pathe from "pathe/utils";
77

8+
import type { RouteConfig } from "../config/routes";
89
import {
910
configRoutesToRouteManifest,
1011
type RouteManifest,
@@ -56,10 +57,13 @@ export async function watch(rootDirectory: string) {
5657
routesViteNodeContext.devServer.moduleGraph.invalidateAll();
5758
routesViteNodeContext.runner.moduleCache.clear();
5859

59-
const result = await routesViteNodeContext.runner.executeFile(routesTsPath);
60+
const routeConfig: RouteConfig = (
61+
await routesViteNodeContext.runner.executeFile(routesTsPath)
62+
).routes;
63+
6064
return {
6165
...routes,
62-
...configRoutesToRouteManifest(result.routes),
66+
...configRoutesToRouteManifest(await routeConfig),
6367
};
6468
}
6569

0 commit comments

Comments
 (0)