From 31077aeb83179fdfeafbb44948fb2914ad64b9b2 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 14 Jan 2025 10:34:20 +0000 Subject: [PATCH] perf(nuxt): avoid checking fs for existence of scanned pages (#30581) --- packages/nuxt/src/pages/utils.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/pages/utils.ts b/packages/nuxt/src/pages/utils.ts index 7f078eed28..327521a10d 100644 --- a/packages/nuxt/src/pages/utils.ts +++ b/packages/nuxt/src/pages/utils.ts @@ -68,7 +68,10 @@ export async function resolvePagesRoutes (nuxt = useNuxt()): Promise return pages } - const augmentCtx = { extraExtractionKeys: nuxt.options.experimental.extraPageMetaExtractionKeys } + const augmentCtx = { + extraExtractionKeys: nuxt.options.experimental.extraPageMetaExtractionKeys, + fullyResolvedPaths: new Set(scannedFiles.map(file => file.absolutePath)), + } if (shouldAugment === 'after-resolve') { await nuxt.callHook('pages:extend', pages) await augmentPages(pages, nuxt.vfs, augmentCtx) @@ -154,6 +157,7 @@ export function generateRoutesFromFiles (files: ScannedFile[], options: Generate } interface AugmentPagesContext { + fullyResolvedPaths?: Set pagesToSkip?: Set augmentedPages?: Set extraExtractionKeys?: string[] @@ -163,7 +167,9 @@ export async function augmentPages (routes: NuxtPage[], vfs: Record