fix(nuxt): generate typed routes after pages are scanned (#26206)

This commit is contained in:
Daniel Roe 2024-03-12 06:28:54 -07:00 committed by GitHub
parent 5089016695
commit a04b88bfcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -192,7 +192,7 @@ export default defineNuxtModule({
}
// Regenerate types/typed-router.d.ts when adding or removing pages
nuxt.hook('builder:generateApp', async (options) => {
nuxt.hook('app:templatesGenerated', async (_app, _templates, options) => {
if (!options?.filter || options.filter({ filename: 'routes.mjs' } as any)) {
await context.scanPages()
}