Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(nuxt): don't force prerender / if user doesn't have that route (#…
Browse files Browse the repository at this point in the history
…8639)

* fix(nuxt): don't force prerender `/` if user doesn't have `~/pages/index.vue`

* docs: add code comment
  • Loading branch information
danielroe committed Nov 3, 2022
1 parent 496fa14 commit 71ecffa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/nuxt/src/pages/module.ts
Expand Up @@ -102,6 +102,9 @@ export default defineNuxtModule({
})
nuxt.hook('nitro:build:before', (nitro) => {
for (const route of nitro.options.prerender.routes || []) {
// Skip default route value as we only generate it if it is already
// in the detected routes from `~/pages`.
if (route === '/') { continue }
prerenderRoutes.add(route)
}
nitro.options.prerender.routes = Array.from(prerenderRoutes)
Expand Down

0 comments on commit 71ecffa

Please sign in to comment.