oedotme / generouted

Generated file-based routes for Vite
https://stackblitz.com/github.com/oedotme/generouted/tree/main/explorer
MIT License
1.02k stars 47 forks source link

BUG: The regex that excludes layouts from routes also excludes any path that has a parent directory starting with `_` #169

Closed vkefallinos closed 3 months ago

vkefallinos commented 3 months ago

https://github.com/oedotme/generouted/blob/5f6774d42925b7c5661199251432174419c7a368/packages/generouted/src/react-location.tsx#L10

For example the project /home/vasi/projects/myproject/_ui/src/ or /home/vasi/_projects/myproject/ui/src/ excludes any page other then _app or 404. When the _ui is renamed to ui the routes are correct. Probably the solution is: ROUTES = import.meta.glob(["/src/pages/**/[\\w[-]*.{jsx,tsx,mdx}", "!**/src/pages/(_!(layout)*(/*)?|_app|404)*"]);

oedotme commented 3 months ago

@vkefallinos Thanks for reporting!

This is now fixed at v1.19.5