-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow dynamic route segments in @astrojs/vercel isr.exclude array #10492
Comments
This sounds more like a feature request, not a bug report. As far as I remember, ISR accepts regex too. |
The route astro/packages/integrations/vercel/src/serverless/adapter.ts Lines 354 to 357 in ad57a02
|
The exclude field currently only accepts verbatim paths, but I think it makes sense for it to handle dynamic and spread segments like It would work similarly to how configured redirects are processed. We have utilities somewhere that turn |
This would be a new feature. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When using the @astrojs/vercel integration, I want to exclude a dynamic route from using ISR. Currently, there seems to be no way to do this. All the routes that are passed into the
isr.exclude
array are matched exactly as is.astro/packages/integrations/vercel/src/serverless/adapter.ts
Lines 354 to 357 in ad57a02
What's the expected result?
The processing of the
isr.exclude
array should offer a way to match dynamic route segments. Therefore, when the code is built, the routesrc
values in the.vercel/output/config.json
file should reflect dynamic route segments accordantly.The strings are currently processed like this:
astro/packages/integrations/vercel/src/lib/redirects.ts
Lines 79 to 81 in ad57a02
It would be nice to enable dynamic values using
/:path
or/[path]
. A solution might look something like this:Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-alhqnq?file=astro.config.mjs
Participation
The text was updated successfully, but these errors were encountered: