fix(nuxt): skip prerendering all pages in hash mode (#24517)

Co-authored-by: Diorcet Yann <diorcet.yann@gmail.com>
This commit is contained in:
Daniel Roe 2023-11-29 01:35:46 +01:00 committed by GitHub
parent 09161d005d
commit 7c6b6771ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -222,7 +222,7 @@ export default defineNuxtModule({
}) })
nuxt.hook('nitro:init', (nitro) => { nuxt.hook('nitro:init', (nitro) => {
if (nuxt.options.dev || !nitro.options.static) { return } if (nuxt.options.dev || !nitro.options.static || nuxt.options.router.options.hashMode) { return }
// Prerender all non-dynamic page routes when generating app // Prerender all non-dynamic page routes when generating app
const prerenderRoutes = new Set<string>() const prerenderRoutes = new Set<string>()
nuxt.hook('pages:extend', (pages) => { nuxt.hook('pages:extend', (pages) => {