Replies: 1 comment
-
Just as you mentioned I use files colocated to the routes which I call |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I generally love filesystem routing. It's intuitive and leads to good results quickly. However, it seems like in every project, I end up:
src/routes/routes.js/ts
file re-enumerating said routes and defining some extra data:It is normally to fulfill the use cases:
my.app:5173/projects/create
->projects > create
. Very useful on chromeless browsers/embeds.routes.ts
It obviously causes code duplication, and I'd really like an elegant 'compile-time' solution, which I'm not sure how to achieve with FS enumeration a-la
import.meta.glob('**/+page.svelte')
+ module exports.It makes me think sveltekit should have a built-in method to: enumerate routes & metadata (#5793 #1142), and export route metadata from
+layout/+page.js
files (static export, unlikePageData/LayoutData
).What's the recommended approach for this? Please share your solution!
Beta Was this translation helpful? Give feedback.
All reactions