We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d8d1fc0 commit 27a95beCopy full SHA for 27a95be
src/module.ts
@@ -534,8 +534,13 @@ declare module 'vue-router' {
534
...prerenderUrls,
535
...((await nitroPromise)._prerenderedRoutes || [])
536
.filter((r) => {
537
- const isExplicitFile = r.route.split('/').pop()!.includes('.')
538
- return r.contentType?.includes('text/html') && !isExplicitFile
+ const lastSegment = r.route.split('/').pop()
+ // check for file in lastSegment using regex
539
+ const isExplicitFile = !!(lastSegment?.match(/\.[0-9a-z]+$/i)?.[0])
540
+ // avoid adding fallback pages to sitemap
541
+ if (r.error || ['/200.html', '/404.html', '/index.html'].includes(r.route))
542
+ return false
543
+ return (r.contentType?.includes('text/html') || !isExplicitFile)
544
})
545
.map(r => r._sitemap),
546
]
0 commit comments