Skip to content

Commit fa801bf

Browse files
feat: support multiple extensions for routes file
1 parent b8a2a5f commit fa801bf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,16 @@ export const pluginReactRouter = (
9797
return {} as Config;
9898
});
9999

100-
const routesPath = resolve(appDirectory, 'routes.ts');
100+
const routesPath = findEntryFile(resolve(appDirectory, 'routes'));
101101

102102
// Then read the routes
103103
const routeConfig = await jiti
104104
.import<RouteConfigEntry[]>(routesPath, {
105105
default: true,
106106
})
107107
.catch(error => {
108-
console.error('Failed to load routes.ts:', error);
109-
console.error('No routes.ts found in app directory.');
108+
console.error('Failed to load routes file:', error);
109+
console.error('No routes file found in app directory.');
110110
return [] as RouteConfigEntry[];
111111
});
112112

0 commit comments

Comments
 (0)