0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00
astro/.changeset/ten-walls-tap.md
Emanuele Stoppa ee38b3a946
refactor(next): send IntegrationRouteData to integrations (#11864)
Co-authored-by: Luiz Ferraz <luiz@lferraz.com>
Co-authored-by: Alexander Niebuhr <alexander@nbhr.io>
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
2024-09-13 11:44:55 +02:00

24 lines
651 B
Markdown

---
'astro': major
---
### [changed]: `RouteData.distURL` is now an array
In Astro v4.x, `RouteData.distURL` was `undefined` or a `URL`
Astro v5.0, `RouteData.distURL` is `undefined` or an array of `URL`. This was a bug, because a route can generate multiple files on disk, especially when using dynamic routes such as `[slug]` or `[...slug]`.
#### What should I do?
Update your code to handle `RouteData.distURL` as an array.
```diff
if (route.distURL) {
- if (route.distURL.endsWith('index.html')) {
- // do something
- }
+ for (const url of route.distURL) {
+ if (url.endsWith('index.html')) {
+ // do something
+ }
+ }
}
```