mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(nuxt): only inject root path in prerender
This commit is contained in:
parent
a05b5343a4
commit
44cada95a6
@ -276,15 +276,11 @@ 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) {
|
||||
if (!nuxt.options.dev && !nuxt.options._prepare && nuxt.options.ssr) {
|
||||
nuxt.hook('app:templatesGenerated', (app) => {
|
||||
const nitro = useNitro()
|
||||
if (nitro.options.prerender.crawlLinks) {
|
||||
for (const page of app.pages!) {
|
||||
if (page.path && !page.path.includes(':')) {
|
||||
nitro.options.prerender.routes.push(page.path)
|
||||
}
|
||||
}
|
||||
nitro.options.prerender.routes.push('/')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user