nitro
nitro copied to clipboard
refactor(netlify): disable `autoSubfolderIndex` for prerendered pages
๐ Linked issue
โ Type of change
- [ ] ๐ Documentation (updates to the documentation, readme, or JSdoc annotations)
- [x] ๐ Bug fix (a non-breaking change that fixes an issue)
- [ ] ๐ Enhancement (improving an existing functionality like performance)
- [ ] โจ New feature (a non-breaking change that adds functionality)
- [ ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
- [ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
๐ Description
This prevents an unnecessary redirect from /page/ to /page when accessing prerendered content.
๐ Checklist
- [ ] I have linked an issue or discussion.
- [ ] I have updated the documentation accordingly.
Adding some links for posterity (I referenced these for my own understanding here!):
prerender.autoSubfolderIndexnitro option: https://nitro.build/config#prerender- why this avoids a 301 redirect in some cases: https://answers.netlify.com/t/support-guide-how-can-i-alter-trailing-slash-behaviour-in-my-urls-will-enabling-pretty-urls-help/31191#p-86000-im-ssg-lessmy-ssg-uses-static-routing-4
Thanks for sharing context @serhalp I am totally fine with later backporting this also to v2, perhaps via compat date if you confirm this is certainly a better default and low chance of breaking behavior ๐๐ผ
/cc @danielroe @TheAlexLichter might have some opinions as it affects current Nuxt users if we backport via compat date.