Closed blowsie closed 1 year ago
also fails on onRoutesGenerated
onRoutesGenerated(routes) {
return routes.map((route) => {
return {
...route,
props: (to) => ({
test: 'it',
}),
}
})
},
Because routes need to be serialize during build time then pass to frontend, so if you want to include some logic in props, try to extends routes in your entry point. ex. main.ts
Describe the bug
Since
yml
andjson5
don't allow us to write JS functions, I tried to extend a route usingextendRoute
, however that fails when writing functions too.Config
Output
Reproduction
https://stackblitz.com/edit/vitejs-vite-zwtdaf?file=vite.config.ts
System Info
Used Package Manager
npm
Validations