Stop writing your own routes
summary
Claim: stop hand-writing route arrays and let a generator produce routes, names and param types. Uses a file-system as router tree combined with an unplugin-based plugin for Vite/Rollup/Webpack to generate a TypeScript file that provides typed route params and autocompletion for router.push, <RouterLink> name usage and useRoute generics. Demoed with Vue Router 4.1 and setupLayouts; route types and completions work and stay fast (avoids prior slow conditional-type approach), though regeneration bugs and an optional data‑fetching RFC remain.
AI-written summary · about
chapters (12)
- 0:00Introduction to routing
- 1:00The complexity of routing
- 2:33Modern routing concepts
- 4:33File-based routing advantages
- 7:35Predictable structure
- 9:53Type-safe route parameters
- 14:01Simplified route management
- 15:58Unplugin view router
- 17:46Live demo and autocompletion
- 24:35Working with typed links
- 27:17Behind the generated code
- 28:29Customizing routes and conclusion








