mirror of https://github.com/nuxt/nuxt.git
Merge 0d35a27f0a
into 52faf52cde
This commit is contained in:
commit
2501d31019
|
@ -64,18 +64,15 @@ export async function resolvePagesRoutes (): Promise<NuxtPage[]> {
|
|||
shouldUseServerComponents: !!nuxt.options.experimental.componentIslands,
|
||||
})
|
||||
|
||||
const pages = uniqueBy(allRoutes, 'path')
|
||||
|
||||
const shouldAugment = nuxt.options.experimental.scanPageMeta || nuxt.options.experimental.typedPages
|
||||
|
||||
const pages = uniqueBy(allRoutes, 'path')
|
||||
|
||||
await nuxt.callHook('pages:extend', pages)
|
||||
if (shouldAugment) {
|
||||
const augmentedPages = await augmentPages(pages, nuxt.vfs)
|
||||
await nuxt.callHook('pages:extend', pages)
|
||||
await augmentPages(pages, nuxt.vfs, augmentedPages)
|
||||
augmentedPages.clear()
|
||||
} else {
|
||||
await nuxt.callHook('pages:extend', pages)
|
||||
await augmentPages(pages, nuxt.vfs)
|
||||
}
|
||||
await nuxt.callHook('pages:resolved', pages)
|
||||
|
||||
return pages
|
||||
}
|
||||
|
|
|
@ -189,6 +189,13 @@ export interface NuxtHooks {
|
|||
*/
|
||||
'pages:extend': (pages: NuxtPage[]) => HookResult
|
||||
|
||||
/**
|
||||
* Called after pages routes are resolved.
|
||||
* @param pages Array containing resolved pages
|
||||
* @returns Promise
|
||||
*/
|
||||
'pages:resolved': (pages: NuxtPage[]) => HookResult
|
||||
|
||||
/**
|
||||
* Called when resolving `app/router.options` files. It allows modifying the detected router options files
|
||||
* and adding new ones.
|
||||
|
|
Loading…
Reference in New Issue