Closed muningis closed 10 months ago
Hi. In your remix.config.js file, you need to ignore all files, otherwise Remix will use its convention before remix-flat-routes
processes them.
Currently, you're only ignoring files that start with .
. Change to ignoredRouteFiles: ["**/*"]
Yikes. I spent too much time checking docs, comparing what's in README, messing around with versions.
Yeah that's the issue.
And also, I'm pretty sure ["**/.*"]
is causing initial-load (or build?) performance issues.
Thanks, and sorry for false flag.
This is config I'm using:
If
BASE_PATH
is something like/my-path
I can passroutes/_some.route.for-page/route
touseRouteLoaderData()
and it works IfBASE_PATH
is/
I've to passroutes/_some.route.for-page
for it to work.And when navigating to some route, I also see that it uses either
routes/_some.route.for-page/route
orroutes/_some.route.for-page
to load the data.node version: 18 remix-flat-routes version: 0.5.10 remix version: 1.18.1
Reproduction: https://github.com/muningis/remix-flat-routes-issue-reproduction
remix.config.js
has:Switch between them
routes/index/route.tsx
has:Navigating to
Lorem
when/test
is used as base path, you can see it will callhttp://localhost:3000/test/post/lorem/?_data=routes%2Fpost.%24slug%2Froute
- and There will be data displayedNavigating to
Lorem
when` is used as base path, you can see it will call
http://localhost:3000/post/lorem/?_data=routes%2Fpost.%24slug` - and data won't be displayed