Skip to content

Commit 44cada9

Browse files
committed
fix(nuxt): only inject root path in prerender
1 parent a05b534 commit 44cada9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/nuxt/src/pages/module.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -276,15 +276,11 @@ export default defineNuxtModule({
276276
})
277277

278278
// TODO: inject routes in `200.html` in next nitro upgrade (2.9.7+) via https://github.com/unjs/nitro/pull/2517
279-
if (!nuxt.options.dev && !nuxt.options._prepare) {
279+
if (!nuxt.options.dev && !nuxt.options._prepare && nuxt.options.ssr) {
280280
nuxt.hook('app:templatesGenerated', (app) => {
281281
const nitro = useNitro()
282282
if (nitro.options.prerender.crawlLinks) {
283-
for (const page of app.pages!) {
284-
if (page.path && !page.path.includes(':')) {
285-
nitro.options.prerender.routes.push(page.path)
286-
}
287-
}
283+
nitro.options.prerender.routes.push('/')
288284
}
289285
})
290286
}

0 commit comments

Comments
 (0)