diff --git a/packages/tuono-fs-router-vite-plugin/src/generator.ts b/packages/tuono-fs-router-vite-plugin/src/generator.ts index 657d90f6..53e5f5b7 100644 --- a/packages/tuono-fs-router-vite-plugin/src/generator.ts +++ b/packages/tuono-fs-router-vite-plugin/src/generator.ts @@ -85,8 +85,7 @@ async function getRouteNodes( } else if (fullPath.match(/\.(rs)$/)) { const filePath = replaceBackslash(path.join(dir, dirent.name)) const filePathNoExt = removeExt(filePath) - let routePath = - cleanPath(`/${filePathNoExt.split('.').join('/')}`) || '' + let routePath = cleanPath(`/${filePathNoExt}`) || '' if (routePath === 'index') { routePath = '/' diff --git a/packages/tuono-fs-router-vite-plugin/tests/generator/catch_all/routeTree.expected.ts b/packages/tuono-fs-router-vite-plugin/tests/generator/catch_all/routeTree.expected.ts index a50af4c9..7910bdd7 100644 --- a/packages/tuono-fs-router-vite-plugin/tests/generator/catch_all/routeTree.expected.ts +++ b/packages/tuono-fs-router-vite-plugin/tests/generator/catch_all/routeTree.expected.ts @@ -24,6 +24,7 @@ const IndexRoute = Index.update({ const PostscatchallRoute = Postscatchall.update({ path: '/posts/[...catch_all]', getParentRoute: () => rootRoute, + hasHandler: true, }) // Create and export the route tree diff --git a/packages/tuono-fs-router-vite-plugin/tests/generator/catch_all/routes/posts/[...catch_all].rs b/packages/tuono-fs-router-vite-plugin/tests/generator/catch_all/routes/posts/[...catch_all].rs new file mode 100644 index 00000000..e69de29b