You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(vercel): allow overriding function config by route (#4124)
* feat(vercel): allow overriding function config by route
* fix: factor in base url with function route matching
* fix: replace arrays rather than merge
* docs(vercel): function config overrides
* Update docs/2.deploy/20.providers/vercel.md
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* test(vercel): move to main fixture
* feat(vercel): generate consumer for queue triggers
* fix(vercel): copy function output instead of symlinking when config overridden
* test: update fixture
* test: copy function output instead of symlinking when config overridden
* test: copy function output instead of symlinking when config overridden
* refactor: use nitro routing
* style: move new utils to end
* test: tidy snapshot
* fix avoid writing extra fn
* update fixture
* rename to functionRules
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Pooya Parsa <pooya@pi0.io>
Copy file name to clipboardExpand all lines: docs/2.deploy/20.providers/vercel.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,35 @@ Alternatively, Nitro also detects Bun automatically if you specify a `bunVersion
55
55
}
56
56
```
57
57
58
+
## Per-route function configuration
59
+
60
+
Use `vercel.functionRules` to override [serverless function settings](https://vercel.com/docs/build-output-api/primitives#serverless-function-configuration) for specific routes. Each key is a route pattern and its value is a partial function configuration object that gets merged with the base `vercel.functions` config. Note: array properties (e.g., `regions`) from route config will replace the base config arrays rather than merging them.
61
+
62
+
This is useful when certain routes need different resource limits, regions, or features like [Vercel Queues triggers](https://vercel.com/docs/queues).
Route patterns support wildcards via [rou3](https://github.com/h3js/rou3) matching (e.g., `/api/slow/**` matches all routes under `/api/slow/`).
86
+
58
87
## Proxy route rules
59
88
60
89
Nitro automatically optimizes `proxy` route rules on Vercel by generating [CDN-level rewrites](https://vercel.com/docs/rewrites) at build time. This means matching requests are proxied at the edge without invoking a serverless function, reducing latency and cost.
0 commit comments