fix(nuxt): add router.options files in definite order (#25397)

This commit is contained in:
Daniel Roe 2024-01-23 17:44:14 +00:00 committed by GitHub
parent c51272099f
commit a42aaecfb5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -38,10 +38,10 @@ export default defineNuxtModule({
// Add default options // Add default options
context.files.push({ path: resolve(runtimeDir, 'router.options'), optional: true }) context.files.push({ path: resolve(runtimeDir, 'router.options'), optional: true })
await Promise.all(nuxt.options._layers.map(async layer => { for (const layer of nuxt.options._layers) {
const path = await findPath(resolve(layer.config.srcDir, 'app/router.options')) const path = await findPath(resolve(layer.config.srcDir, 'app/router.options'))
if (path) { context.files.push({ path }) } if (path) { context.files.push({ path }) }
})) }
await nuxt.callHook('pages:routerOptions', context) await nuxt.callHook('pages:routerOptions', context)
return context.files return context.files