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: documentation/docs/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
@@ -30,29 +30,20 @@ export default config;
30
30
31
31
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.
32
32
33
-
For example you could deploy some parts of your app as [Edge Functions](https://vercel.com/docs/concepts/functions/edge-functions)...
33
+
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
46
+
> [!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
56
47
-`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
57
48
-`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
58
49
@@ -64,6 +55,8 @@ And the following option apply to serverless functions:
64
55
-`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
65
56
-`isr`: configuration Incremental Static Regeneration, described below
66
57
58
+
Configuration set in a layout applies to all the routes beneath that layout, unless overridden at a more granular level.
59
+
67
60
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.
68
61
69
62
## Image Optimization
@@ -95,7 +88,7 @@ export default config;
95
88
96
89
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.
97
90
98
-
> 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
91
+
> [!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
99
92
100
93
To add ISR to a route, include the `isr` property in your `config` object:
101
94
@@ -112,7 +105,7 @@ export const config = {
112
105
};
113
106
```
114
107
115
-
> Using ISR on a route with `export const prerender = true` will have no effect, since the route is prerendered at build time
108
+
> [!NOTE]Using ISR on a route with `export const prerender = true` will have no effect, since the route is prerendered at build time
116
109
117
110
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.
146
139
147
-
> Pages that are [prerendered](page-options#prerender) will ignore ISR configuration.
140
+
> [!NOTE]Pages that are [prerendered](page-options#prerender) will ignore ISR configuration.
* Whether to use [Edge Functions](https://vercel.com/docs/concepts/functions/edge-functions) (`'edge'`) or [Serverless Functions](https://vercel.com/docs/concepts/functions/serverless-functions) (`'nodejs18.x'`, `'nodejs20.x'` etc).
9
9
* @default Same as the build environment
10
+
* @deprecated
10
11
*/
11
12
runtime?: `nodejs${number}.x`;
12
13
/**
@@ -74,6 +75,7 @@ type ImagesConfig = {
74
75
contentDispositionType?: string;
75
76
};
76
77
78
+
/** @deprecated */
77
79
exportinterfaceEdgeConfig{
78
80
/**
79
81
* Whether to use [Edge Functions](https://vercel.com/docs/concepts/functions/edge-functions) (`'edge'`) or [Serverless Functions](https://vercel.com/docs/concepts/functions/serverless-functions) (`'nodejs18.x'`, `'nodejs20.x'` etc).
0 commit comments