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
Copy file name to clipboardExpand all lines: apps/svelte.dev/content/docs/kit/25-build-and-deploy/90-adapter-vercel.md
+8-15Lines changed: 8 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,29 +31,20 @@ export default config;
31
31
32
32
To control how your routes are deployed to Vercel as functions, you can specify deployment configuration, either through the option shown above or with [`export const config`](page-options#config) inside `+server.js`, `+page(.server).js` and `+layout(.server).js` files.
33
33
34
-
For example you could deploy some parts of your app as [Edge Functions](https://vercel.com/docs/concepts/functions/edge-functions)...
34
+
For example you could deploy one specific route as an individual serverless function, separate from the rest of your app:
...and others as [Serverless Functions](https://vercel.com/docs/concepts/functions/serverless-functions) (note that by specifying `config` inside a layout, it applies to all child pages):
-`runtime`: `'edge'`, `'nodejs18.x'`, `'nodejs20.x'` or `'nodejs22.x'`. By default, the adapter will select the `'nodejs<version>.x'` corresponding to the Node version your project is configured to use on the Vercel dashboard
47
+
> [!NOTE] This option is deprecated and will be removed in a future version, at which point all your functions will use whichever Node version is specified in the project configuration on Vercel
57
48
-`regions`: an array of [edge network regions](https://vercel.com/docs/concepts/edge-network/regions) (defaulting to `["iad1"]` for serverless functions) or `'all'` if `runtime` is `edge` (its default). Note that multiple regions for serverless functions are only supported on Enterprise plans
58
49
-`split`: if `true`, causes a route to be deployed as an individual function. If `split` is set to `true` at the adapter level, all routes will be deployed as individual functions
59
50
@@ -65,6 +56,8 @@ And the following option apply to serverless functions:
65
56
-`maxDuration`: [maximum execution duration](https://vercel.com/docs/functions/runtimes#max-duration) of the function. Defaults to `10` seconds for Hobby accounts, `15` for Pro and `900` for Enterprise
66
57
-`isr`: configuration Incremental Static Regeneration, described below
67
58
59
+
Configuration set in a layout applies to all the routes beneath that layout, unless overridden at a more granular level.
60
+
68
61
If your functions need to access data in a specific region, it's recommended that they be deployed in the same region (or close to it) for optimal performance.
69
62
70
63
## Image Optimization
@@ -96,7 +89,7 @@ export default config;
96
89
97
90
Vercel supports [Incremental Static Regeneration](https://vercel.com/docs/incremental-static-regeneration) (ISR), which provides the performance and cost advantages of prerendered content with the flexibility of dynamically rendered content.
98
91
99
-
> Use ISR only on routes where every visitor should see the same content (much like when you prerender). If there's anything user-specific happening (like session cookies), they should happen on the client via JavaScript only to not leak sensitive information across visits
92
+
> [!NOTE]Use ISR only on routes where every visitor should see the same content (much like when you prerender). If there's anything user-specific happening (like session cookies), they should happen on the client via JavaScript only to not leak sensitive information across visits
100
93
101
94
To add ISR to a route, include the `isr` property in your `config` object:
102
95
@@ -113,7 +106,7 @@ export const config = {
113
106
};
114
107
```
115
108
116
-
> Using ISR on a route with `export const prerender = true` will have no effect, since the route is prerendered at build time
109
+
> [!NOTE]Using ISR on a route with `export const prerender = true` will have no effect, since the route is prerendered at build time
117
110
118
111
The `expiration` property is required; all others are optional. The properties are discussed in more detail below.
A list of valid query parameters that contribute to the cache key. Other parameters (such as utm tracking codes) will be ignored, ensuring that they do not result in content being re-generated unnecessarily. By default, query parameters are ignored.
147
140
148
-
> Pages that are [prerendered](page-options#prerender) will ignore ISR configuration.
141
+
> [!NOTE]Pages that are [prerendered](page-options#prerender) will ignore ISR configuration.
0 commit comments