diff --git a/src/prerender.ts b/src/prerender.ts index 4ba23e58..ca6fad2f 100644 --- a/src/prerender.ts +++ b/src/prerender.ts @@ -58,7 +58,7 @@ export function setupPrerenderHandler(moduleConfig: ModuleOptions, buildTimeMeta return const prerenderUrls = (nitro._prerenderedRoutes || []) - .filter(r => !r.route.includes('.') && !r.route.startsWith('/api/')) + .filter(r => r.fileName === '.html' && !r.route.startsWith('/api/')) .map(r => ({ loc: r.route })) || [] if (buildTimeMeta.hasPrerenderedRoutesPayload) { diff --git a/src/utils.ts b/src/utils.ts index 4492dca3..a8c0fdd1 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -4,6 +4,7 @@ import { joinURL } from 'ufo' import type { Nuxt } from '@nuxt/schema' import { loadNuxtModuleInstance, normalizeSemanticVersion, useNuxt } from '@nuxt/kit' import { satisfies } from 'semver' +import { extname } from 'pathe' import type { SitemapEntryInput } from './runtime/types' export interface NuxtPagesToSitemapEntriesOptions { @@ -206,6 +207,6 @@ export function generateExtraRoutesFromNuxtConfig(nuxt: Nuxt = useNuxt()) { .map(([k]) => k) // don't support files const prerenderUrls = (nuxt.options.nitro.prerender?.routes || []) - .filter(p => p && !p.includes('.') && !p.startsWith('/api/')) as string[] + .filter(p => p && !extname(p) && !p.startsWith('/api/')) as string[] return { routeRules, prerenderUrls } }