mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(nuxt): add /
even if pages module isn't enabled
This commit is contained in:
parent
cb77ddc308
commit
dabcb5ecc9
@ -498,7 +498,11 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
|
|||||||
for (const route of ['/200.html', '/404.html']) {
|
for (const route of ['/200.html', '/404.html']) {
|
||||||
routes.add(route)
|
routes.add(route)
|
||||||
}
|
}
|
||||||
if (!nuxt.options.ssr) {
|
if (nuxt.options.ssr) {
|
||||||
|
if (nitro.options.prerender.crawlLinks) {
|
||||||
|
routes.add('/')
|
||||||
|
}
|
||||||
|
} else {
|
||||||
routes.add('/index.html')
|
routes.add('/index.html')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -275,16 +275,6 @@ export default defineNuxtModule({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: inject routes in `200.html` in next nitro upgrade (2.9.7+) via https://github.com/unjs/nitro/pull/2517
|
|
||||||
if (!nuxt.options.dev && !nuxt.options._prepare && nuxt.options.ssr) {
|
|
||||||
nuxt.hook('app:templatesGenerated', () => {
|
|
||||||
const nitro = useNitro()
|
|
||||||
if (nitro.options.prerender.crawlLinks) {
|
|
||||||
nitro.options.prerender.routes.push('/')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
nuxt.hook('imports:extend', (imports) => {
|
nuxt.hook('imports:extend', (imports) => {
|
||||||
imports.push(
|
imports.push(
|
||||||
{ name: 'definePageMeta', as: 'definePageMeta', from: resolve(runtimeDir, 'composables') },
|
{ name: 'definePageMeta', as: 'definePageMeta', from: resolve(runtimeDir, 'composables') },
|
||||||
|
Loading…
Reference in New Issue
Block a user