fix(nuxt): register augmented pages to avoid re-augmenting

This commit is contained in:
Daniel Roe 2024-06-11 09:23:48 +01:00
parent 13fec55c10
commit b75bf870be
No known key found for this signature in database
GPG Key ID: CBC814C393D93268

View File

@ -144,6 +144,7 @@ export async function augmentPages (routes: NuxtPage[], vfs: Record<string, stri
if (!augmentedPages.has(route) && route.file) { if (!augmentedPages.has(route) && route.file) {
const fileContent = route.file in vfs ? vfs[route.file] : fs.readFileSync(await resolvePath(route.file), 'utf-8') const fileContent = route.file in vfs ? vfs[route.file] : fs.readFileSync(await resolvePath(route.file), 'utf-8')
Object.assign(route, await getRouteMeta(fileContent, route.file)) Object.assign(route, await getRouteMeta(fileContent, route.file))
augmentedPages.add(route)
} }
if (route.children && route.children.length > 0) { if (route.children && route.children.length > 0) {