nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.71k stars 478 forks source link

fix: ignore root when prerendering using `strategy: 'prefix'` #2894

Closed BobbieGoede closed 6 months ago

BobbieGoede commented 6 months ago

πŸ”— Linked issue

❓ Type of change

πŸ“š Description

Resolves #2855

Not sure how to test this exactly πŸ€”

These changes removes/ignores the / entry route added by nitro during prerendering and adds localized entry pages to use instead. This also excludes the / route from the generated build, which I think is/was the original behavior when running generate with strategy prefix (currently without these changes this throws an error).

When not prerendering we re-add the index page (not localized) so that requests on root can be redirected.

πŸ“ Checklist