fix(nuxt): add catchall paths to prerender list (#8782)

This commit is contained in:
Daniel Roe 2022-11-09 10:00:34 +01:00 committed by GitHub
parent e76ebdddd0
commit 30d99477ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,6 +90,8 @@ export default defineNuxtModule({
prerenderRoutes.clear()
const processPages = (pages: NuxtPage[], currentPath = '/') => {
for (const page of pages) {
// Add root of optional dynamic paths and catchalls
if (page.path.match(/^\/?:.*(\?|\(\.\*\)\*)$/) && !page.children?.length) { prerenderRoutes.add(currentPath) }
// Skip dynamic paths
if (page.path.includes(':')) { continue }
const route = joinURL(currentPath, page.path)