diff --git a/src/module.ts b/src/module.ts index 9b9540c7..ffbad1c6 100644 --- a/src/module.ts +++ b/src/module.ts @@ -243,7 +243,6 @@ export default defineNuxtModule({ // @ts-expect-error runtime types const nuxtI18nConfig = nuxt.options.i18n as Record | undefined if (nuxtI18nConfig?.pages) { - config.inferStaticPagesAsRoutes = false for (const pageLocales of Object.values(nuxtI18nConfig?.pages as Record>)) { for (const locale in pageLocales) { // add root entry for default locale and ignore dynamic routes diff --git a/test/i18n.test.ts b/test/i18n.test.ts index ca2818f6..1e886ce3 100644 --- a/test/i18n.test.ts +++ b/test/i18n.test.ts @@ -51,75 +51,78 @@ describe('i18n', () => { posts = posts.replace(/.*<\/lastmod>/g, '') expect(posts).toMatchInlineSnapshot(` - " - - - - -

[ - "posts-sitemap.xml" - ]

Made by Harlan Wilton
- " + " + + + https://nuxtseo.com/blog/post-1 + + + https://nuxtseo.com/blog/post-2 + + + https://nuxtseo.com/blog/post-3 + + + https://nuxtseo.com/blog/post-4 + + + https://nuxtseo.com/blog/post-5 + + + " `) expect((await $fetch('/pages-sitemap.xml')).replace(/.*<\/lastmod>/g, '')).toMatchInlineSnapshot(` - " - - - - -

[ - "pages-sitemap.xml" - ]

Made by Harlan Wilton
- " + " + + + https://nuxtseo.com/about + + + + + https://nuxtseo.com/image.jpg + + + https://nuxtseo.com/image2.jpg + + + https://nuxtseo.com/image-3.jpg + + daily + 0.3 + + + https://nuxtseo.com/services + + + + https://nuxtseo.com/users-lazy/1 + + + https://nuxtseo.com/users-lazy/2 + + + https://nuxtseo.com/users-lazy/3 + + + https://nuxtseo.com/services/coaching + + + + https://nuxtseo.com/services/development + + + + https://nuxtseo.com/services/development/app + + + + https://nuxtseo.com/services/development/website + + + + " `) }, 60000) })