From fa801bfc8acfa1ab216aea90dc237b7184c941ca Mon Sep 17 00:00:00 2001 From: ScriptedAlchemy Date: Thu, 27 Mar 2025 00:35:54 -0600 Subject: [PATCH 1/2] feat: support multiple extensions for routes file --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index f2ce36a..d5e0b3d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -97,7 +97,7 @@ export const pluginReactRouter = ( return {} as Config; }); - const routesPath = resolve(appDirectory, 'routes.ts'); + const routesPath = findEntryFile(resolve(appDirectory, 'routes')); // Then read the routes const routeConfig = await jiti @@ -105,8 +105,8 @@ export const pluginReactRouter = ( default: true, }) .catch(error => { - console.error('Failed to load routes.ts:', error); - console.error('No routes.ts found in app directory.'); + console.error('Failed to load routes file:', error); + console.error('No routes file found in app directory.'); return [] as RouteConfigEntry[]; }); From ffec1768e05efb52ebeaaf9d25515faa4ab08481 Mon Sep 17 00:00:00 2001 From: ScriptedAlchemy Date: Thu, 27 Mar 2025 16:48:28 -0600 Subject: [PATCH 2/2] changeset --- .changeset/cold-icons-lick.md | 5 +++++ .changeset/social-flowers-itch.md | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/cold-icons-lick.md create mode 100644 .changeset/social-flowers-itch.md diff --git a/.changeset/cold-icons-lick.md b/.changeset/cold-icons-lick.md new file mode 100644 index 0000000..d514352 --- /dev/null +++ b/.changeset/cold-icons-lick.md @@ -0,0 +1,5 @@ +--- +'rsbuild-plugin-react-router': patch +--- + +search for routes file with any extention diff --git a/.changeset/social-flowers-itch.md b/.changeset/social-flowers-itch.md new file mode 100644 index 0000000..30f70c8 --- /dev/null +++ b/.changeset/social-flowers-itch.md @@ -0,0 +1,5 @@ +--- +'rsbuild-plugin-react-router': patch +--- + +support multiple extentions for routes file, like js,ts,jsx etc