vite-plugin-vercel 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -2,494 +2,516 @@ import { ResolvedConfig, Plugin } from 'vite';
2
2
  import { StdinOptions, BuildOptions } from 'esbuild';
3
3
  import { z } from 'zod';
4
4
 
5
- declare const routesManifestDynamicRouteSchema: z.ZodObject<{
6
- page: z.ZodString;
7
- regex: z.ZodString;
8
- routeKeys: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
9
- namedRegex: z.ZodOptional<z.ZodString>;
10
- }, "strict", z.ZodTypeAny, {
11
- routeKeys?: Record<string, string> | undefined;
12
- namedRegex?: string | undefined;
13
- regex: string;
14
- page: string;
15
- }, {
16
- routeKeys?: Record<string, string> | undefined;
17
- namedRegex?: string | undefined;
18
- regex: string;
19
- page: string;
20
- }>;
21
- declare const routesManifestSchema: z.ZodObject<{
5
+ /**
6
+ * Schema definition for `.vercel/output/config.json`
7
+ * @see {@link https://vercel.com/docs/build-output-api/v3#build-output-configuration}
8
+ */
9
+
10
+ declare const vercelOutputConfigSchema: z.ZodObject<{
22
11
  version: z.ZodLiteral<3>;
23
- basePath: z.ZodString;
24
- pages404: z.ZodBoolean;
25
- redirects: z.ZodOptional<z.ZodArray<z.ZodObject<{
26
- source: z.ZodString;
27
- destination: z.ZodString;
28
- statusCode: z.ZodEffects<z.ZodNumber, number, number>;
29
- regex: z.ZodString;
30
- }, "strict", z.ZodTypeAny, {
31
- source: string;
32
- destination: string;
33
- statusCode: number;
34
- regex: string;
35
- }, {
36
- source: string;
37
- destination: string;
38
- statusCode: number;
39
- regex: string;
40
- }>, "many">>;
41
- headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
42
- source: z.ZodString;
43
- headers: z.ZodArray<z.ZodObject<{
44
- key: z.ZodString;
12
+ routes: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
13
+ src: z.ZodString;
14
+ dest: z.ZodOptional<z.ZodString>;
15
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
16
+ methods: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
17
+ status: z.ZodOptional<z.ZodNumber>;
18
+ continue: z.ZodOptional<z.ZodBoolean>;
19
+ check: z.ZodOptional<z.ZodBoolean>;
20
+ missing: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
21
+ type: z.ZodLiteral<"host">;
45
22
  value: z.ZodString;
46
23
  }, "strict", z.ZodTypeAny, {
47
24
  value: string;
48
- key: string;
25
+ type: "host";
49
26
  }, {
50
27
  value: string;
28
+ type: "host";
29
+ }>, z.ZodObject<{
30
+ type: z.ZodLiteral<"header">;
31
+ key: z.ZodString;
32
+ value: z.ZodOptional<z.ZodString>;
33
+ }, "strict", z.ZodTypeAny, {
34
+ value?: string | undefined;
35
+ type: "header";
51
36
  key: string;
52
- }>, "many">;
53
- regex: z.ZodString;
54
- }, "strict", z.ZodTypeAny, {
55
- source: string;
56
- regex: string;
57
- headers: {
58
- value: string;
37
+ }, {
38
+ value?: string | undefined;
39
+ type: "header";
59
40
  key: string;
60
- }[];
61
- }, {
62
- source: string;
63
- regex: string;
64
- headers: {
65
- value: string;
41
+ }>, z.ZodObject<{
42
+ type: z.ZodLiteral<"cookie">;
43
+ key: z.ZodString;
44
+ value: z.ZodOptional<z.ZodString>;
45
+ }, "strict", z.ZodTypeAny, {
46
+ value?: string | undefined;
47
+ type: "cookie";
66
48
  key: string;
67
- }[];
68
- }>, "many">>;
69
- rewrites: z.ZodOptional<z.ZodArray<z.ZodObject<{
70
- source: z.ZodString;
71
- has: z.ZodOptional<z.ZodArray<z.ZodObject<{
49
+ }, {
50
+ value?: string | undefined;
51
+ type: "cookie";
52
+ key: string;
53
+ }>, z.ZodObject<{
54
+ type: z.ZodLiteral<"query">;
72
55
  key: z.ZodString;
56
+ value: z.ZodOptional<z.ZodString>;
57
+ }, "strict", z.ZodTypeAny, {
58
+ value?: string | undefined;
59
+ type: "query";
60
+ key: string;
61
+ }, {
62
+ value?: string | undefined;
63
+ type: "query";
64
+ key: string;
65
+ }>]>, "many">>;
66
+ has: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
67
+ type: z.ZodLiteral<"host">;
73
68
  value: z.ZodString;
74
- type: z.ZodEnum<["header", "cookie", "host", "query"]>;
75
69
  }, "strict", z.ZodTypeAny, {
76
70
  value: string;
77
- type: "header" | "cookie" | "host" | "query";
78
- key: string;
71
+ type: "host";
79
72
  }, {
80
73
  value: string;
81
- type: "header" | "cookie" | "host" | "query";
74
+ type: "host";
75
+ }>, z.ZodObject<{
76
+ type: z.ZodLiteral<"header">;
77
+ key: z.ZodString;
78
+ value: z.ZodOptional<z.ZodString>;
79
+ }, "strict", z.ZodTypeAny, {
80
+ value?: string | undefined;
81
+ type: "header";
82
+ key: string;
83
+ }, {
84
+ value?: string | undefined;
85
+ type: "header";
86
+ key: string;
87
+ }>, z.ZodObject<{
88
+ type: z.ZodLiteral<"cookie">;
89
+ key: z.ZodString;
90
+ value: z.ZodOptional<z.ZodString>;
91
+ }, "strict", z.ZodTypeAny, {
92
+ value?: string | undefined;
93
+ type: "cookie";
82
94
  key: string;
83
- }>, "many">>;
84
- destination: z.ZodString;
85
- regex: z.ZodString;
95
+ }, {
96
+ value?: string | undefined;
97
+ type: "cookie";
98
+ key: string;
99
+ }>, z.ZodObject<{
100
+ type: z.ZodLiteral<"query">;
101
+ key: z.ZodString;
102
+ value: z.ZodOptional<z.ZodString>;
103
+ }, "strict", z.ZodTypeAny, {
104
+ value?: string | undefined;
105
+ type: "query";
106
+ key: string;
107
+ }, {
108
+ value?: string | undefined;
109
+ type: "query";
110
+ key: string;
111
+ }>]>, "many">>;
112
+ locale: z.ZodOptional<z.ZodObject<{
113
+ redirect: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
114
+ cookie: z.ZodOptional<z.ZodString>;
115
+ }, "strict", z.ZodTypeAny, {
116
+ cookie?: string | undefined;
117
+ redirect?: Record<string, string> | undefined;
118
+ }, {
119
+ cookie?: string | undefined;
120
+ redirect?: Record<string, string> | undefined;
121
+ }>>;
122
+ middlewarePath: z.ZodOptional<z.ZodString>;
86
123
  }, "strict", z.ZodTypeAny, {
87
- has?: {
124
+ status?: number | undefined;
125
+ dest?: string | undefined;
126
+ headers?: Record<string, string> | undefined;
127
+ methods?: string[] | undefined;
128
+ continue?: boolean | undefined;
129
+ check?: boolean | undefined;
130
+ missing?: ({
131
+ value: string;
132
+ type: "host";
133
+ } | {
134
+ value?: string | undefined;
135
+ type: "header";
136
+ key: string;
137
+ } | {
138
+ value?: string | undefined;
139
+ type: "cookie";
140
+ key: string;
141
+ } | {
142
+ value?: string | undefined;
143
+ type: "query";
144
+ key: string;
145
+ })[] | undefined;
146
+ has?: ({
88
147
  value: string;
89
- type: "header" | "cookie" | "host" | "query";
148
+ type: "host";
149
+ } | {
150
+ value?: string | undefined;
151
+ type: "header";
152
+ key: string;
153
+ } | {
154
+ value?: string | undefined;
155
+ type: "cookie";
90
156
  key: string;
91
- }[] | undefined;
92
- source: string;
93
- destination: string;
94
- regex: string;
157
+ } | {
158
+ value?: string | undefined;
159
+ type: "query";
160
+ key: string;
161
+ })[] | undefined;
162
+ locale?: {
163
+ cookie?: string | undefined;
164
+ redirect?: Record<string, string> | undefined;
165
+ } | undefined;
166
+ middlewarePath?: string | undefined;
167
+ src: string;
95
168
  }, {
96
- has?: {
169
+ status?: number | undefined;
170
+ dest?: string | undefined;
171
+ headers?: Record<string, string> | undefined;
172
+ methods?: string[] | undefined;
173
+ continue?: boolean | undefined;
174
+ check?: boolean | undefined;
175
+ missing?: ({
97
176
  value: string;
98
- type: "header" | "cookie" | "host" | "query";
177
+ type: "host";
178
+ } | {
179
+ value?: string | undefined;
180
+ type: "header";
99
181
  key: string;
100
- }[] | undefined;
101
- source: string;
102
- destination: string;
103
- regex: string;
104
- }>, "many">>;
105
- dynamicRoutes: z.ZodOptional<z.ZodArray<z.ZodObject<{
106
- page: z.ZodString;
107
- regex: z.ZodString;
108
- routeKeys: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
109
- namedRegex: z.ZodOptional<z.ZodString>;
182
+ } | {
183
+ value?: string | undefined;
184
+ type: "cookie";
185
+ key: string;
186
+ } | {
187
+ value?: string | undefined;
188
+ type: "query";
189
+ key: string;
190
+ })[] | undefined;
191
+ has?: ({
192
+ value: string;
193
+ type: "host";
194
+ } | {
195
+ value?: string | undefined;
196
+ type: "header";
197
+ key: string;
198
+ } | {
199
+ value?: string | undefined;
200
+ type: "cookie";
201
+ key: string;
202
+ } | {
203
+ value?: string | undefined;
204
+ type: "query";
205
+ key: string;
206
+ })[] | undefined;
207
+ locale?: {
208
+ cookie?: string | undefined;
209
+ redirect?: Record<string, string> | undefined;
210
+ } | undefined;
211
+ middlewarePath?: string | undefined;
212
+ src: string;
213
+ }>, z.ZodObject<{
214
+ handle: z.ZodUnion<[z.ZodLiteral<"rewrite">, z.ZodLiteral<"filesystem">, z.ZodLiteral<"resource">, z.ZodLiteral<"miss">, z.ZodLiteral<"hit">, z.ZodLiteral<"error">]>;
215
+ src: z.ZodOptional<z.ZodString>;
216
+ dest: z.ZodOptional<z.ZodString>;
217
+ status: z.ZodOptional<z.ZodNumber>;
218
+ }, "strict", z.ZodTypeAny, {
219
+ status?: number | undefined;
220
+ src?: string | undefined;
221
+ dest?: string | undefined;
222
+ handle: "error" | "rewrite" | "filesystem" | "resource" | "miss" | "hit";
223
+ }, {
224
+ status?: number | undefined;
225
+ src?: string | undefined;
226
+ dest?: string | undefined;
227
+ handle: "error" | "rewrite" | "filesystem" | "resource" | "miss" | "hit";
228
+ }>]>, "many">>;
229
+ images: z.ZodOptional<z.ZodObject<{
230
+ sizes: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
231
+ domains: z.ZodOptional<z.ZodArray<z.ZodString, "atleastone">>;
232
+ minimumCacheTTL: z.ZodOptional<z.ZodNumber>;
233
+ formats: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"image/avif">, z.ZodLiteral<"image/webp">]>, "atleastone">>;
234
+ dangerouslyAllowSVG: z.ZodOptional<z.ZodBoolean>;
235
+ contentSecurityPolicy: z.ZodOptional<z.ZodString>;
236
+ }, "strict", z.ZodTypeAny, {
237
+ domains?: [string, ...string[]] | undefined;
238
+ minimumCacheTTL?: number | undefined;
239
+ formats?: ["image/avif" | "image/webp", ...("image/avif" | "image/webp")[]] | undefined;
240
+ dangerouslyAllowSVG?: boolean | undefined;
241
+ contentSecurityPolicy?: string | undefined;
242
+ sizes: [number, number];
243
+ }, {
244
+ domains?: [string, ...string[]] | undefined;
245
+ minimumCacheTTL?: number | undefined;
246
+ formats?: ["image/avif" | "image/webp", ...("image/avif" | "image/webp")[]] | undefined;
247
+ dangerouslyAllowSVG?: boolean | undefined;
248
+ contentSecurityPolicy?: string | undefined;
249
+ sizes: [number, number];
250
+ }>>;
251
+ wildcard: z.ZodOptional<z.ZodArray<z.ZodObject<{
252
+ domain: z.ZodString;
253
+ value: z.ZodString;
110
254
  }, "strict", z.ZodTypeAny, {
111
- routeKeys?: Record<string, string> | undefined;
112
- namedRegex?: string | undefined;
113
- regex: string;
114
- page: string;
255
+ value: string;
256
+ domain: string;
115
257
  }, {
116
- routeKeys?: Record<string, string> | undefined;
117
- namedRegex?: string | undefined;
118
- regex: string;
119
- page: string;
258
+ value: string;
259
+ domain: string;
120
260
  }>, "many">>;
261
+ overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
262
+ path: z.ZodOptional<z.ZodString>;
263
+ contentType: z.ZodOptional<z.ZodString>;
264
+ }, "strict", z.ZodTypeAny, {
265
+ path?: string | undefined;
266
+ contentType?: string | undefined;
267
+ }, {
268
+ path?: string | undefined;
269
+ contentType?: string | undefined;
270
+ }>>>;
271
+ cache: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
121
272
  }, "strict", z.ZodTypeAny, {
122
- dynamicRoutes?: {
123
- routeKeys?: Record<string, string> | undefined;
124
- namedRegex?: string | undefined;
125
- regex: string;
126
- page: string;
127
- }[] | undefined;
128
- redirects?: {
129
- source: string;
130
- destination: string;
131
- statusCode: number;
132
- regex: string;
133
- }[] | undefined;
134
- headers?: {
135
- source: string;
136
- regex: string;
137
- headers: {
273
+ routes?: ({
274
+ status?: number | undefined;
275
+ dest?: string | undefined;
276
+ headers?: Record<string, string> | undefined;
277
+ methods?: string[] | undefined;
278
+ continue?: boolean | undefined;
279
+ check?: boolean | undefined;
280
+ missing?: ({
138
281
  value: string;
282
+ type: "host";
283
+ } | {
284
+ value?: string | undefined;
285
+ type: "header";
139
286
  key: string;
140
- }[];
141
- }[] | undefined;
142
- rewrites?: {
143
- has?: {
287
+ } | {
288
+ value?: string | undefined;
289
+ type: "cookie";
290
+ key: string;
291
+ } | {
292
+ value?: string | undefined;
293
+ type: "query";
294
+ key: string;
295
+ })[] | undefined;
296
+ has?: ({
144
297
  value: string;
145
- type: "header" | "cookie" | "host" | "query";
298
+ type: "host";
299
+ } | {
300
+ value?: string | undefined;
301
+ type: "header";
146
302
  key: string;
147
- }[] | undefined;
148
- source: string;
149
- destination: string;
150
- regex: string;
303
+ } | {
304
+ value?: string | undefined;
305
+ type: "cookie";
306
+ key: string;
307
+ } | {
308
+ value?: string | undefined;
309
+ type: "query";
310
+ key: string;
311
+ })[] | undefined;
312
+ locale?: {
313
+ cookie?: string | undefined;
314
+ redirect?: Record<string, string> | undefined;
315
+ } | undefined;
316
+ middlewarePath?: string | undefined;
317
+ src: string;
318
+ } | {
319
+ status?: number | undefined;
320
+ src?: string | undefined;
321
+ dest?: string | undefined;
322
+ handle: "error" | "rewrite" | "filesystem" | "resource" | "miss" | "hit";
323
+ })[] | undefined;
324
+ images?: {
325
+ domains?: [string, ...string[]] | undefined;
326
+ minimumCacheTTL?: number | undefined;
327
+ formats?: ["image/avif" | "image/webp", ...("image/avif" | "image/webp")[]] | undefined;
328
+ dangerouslyAllowSVG?: boolean | undefined;
329
+ contentSecurityPolicy?: string | undefined;
330
+ sizes: [number, number];
331
+ } | undefined;
332
+ wildcard?: {
333
+ value: string;
334
+ domain: string;
151
335
  }[] | undefined;
336
+ overrides?: Record<string, {
337
+ path?: string | undefined;
338
+ contentType?: string | undefined;
339
+ }> | undefined;
340
+ cache?: string[] | undefined;
152
341
  version: 3;
153
- basePath: string;
154
- pages404: boolean;
155
342
  }, {
156
- dynamicRoutes?: {
157
- routeKeys?: Record<string, string> | undefined;
158
- namedRegex?: string | undefined;
159
- regex: string;
160
- page: string;
161
- }[] | undefined;
162
- redirects?: {
163
- source: string;
164
- destination: string;
165
- statusCode: number;
166
- regex: string;
167
- }[] | undefined;
168
- headers?: {
169
- source: string;
170
- regex: string;
171
- headers: {
343
+ routes?: ({
344
+ status?: number | undefined;
345
+ dest?: string | undefined;
346
+ headers?: Record<string, string> | undefined;
347
+ methods?: string[] | undefined;
348
+ continue?: boolean | undefined;
349
+ check?: boolean | undefined;
350
+ missing?: ({
172
351
  value: string;
352
+ type: "host";
353
+ } | {
354
+ value?: string | undefined;
355
+ type: "header";
173
356
  key: string;
174
- }[];
175
- }[] | undefined;
176
- rewrites?: {
177
- has?: {
357
+ } | {
358
+ value?: string | undefined;
359
+ type: "cookie";
360
+ key: string;
361
+ } | {
362
+ value?: string | undefined;
363
+ type: "query";
364
+ key: string;
365
+ })[] | undefined;
366
+ has?: ({
178
367
  value: string;
179
- type: "header" | "cookie" | "host" | "query";
368
+ type: "host";
369
+ } | {
370
+ value?: string | undefined;
371
+ type: "header";
180
372
  key: string;
181
- }[] | undefined;
182
- source: string;
183
- destination: string;
184
- regex: string;
373
+ } | {
374
+ value?: string | undefined;
375
+ type: "cookie";
376
+ key: string;
377
+ } | {
378
+ value?: string | undefined;
379
+ type: "query";
380
+ key: string;
381
+ })[] | undefined;
382
+ locale?: {
383
+ cookie?: string | undefined;
384
+ redirect?: Record<string, string> | undefined;
385
+ } | undefined;
386
+ middlewarePath?: string | undefined;
387
+ src: string;
388
+ } | {
389
+ status?: number | undefined;
390
+ src?: string | undefined;
391
+ dest?: string | undefined;
392
+ handle: "error" | "rewrite" | "filesystem" | "resource" | "miss" | "hit";
393
+ })[] | undefined;
394
+ images?: {
395
+ domains?: [string, ...string[]] | undefined;
396
+ minimumCacheTTL?: number | undefined;
397
+ formats?: ["image/avif" | "image/webp", ...("image/avif" | "image/webp")[]] | undefined;
398
+ dangerouslyAllowSVG?: boolean | undefined;
399
+ contentSecurityPolicy?: string | undefined;
400
+ sizes: [number, number];
401
+ } | undefined;
402
+ wildcard?: {
403
+ value: string;
404
+ domain: string;
185
405
  }[] | undefined;
406
+ overrides?: Record<string, {
407
+ path?: string | undefined;
408
+ contentType?: string | undefined;
409
+ }> | undefined;
410
+ cache?: string[] | undefined;
186
411
  version: 3;
187
- basePath: string;
188
- pages404: boolean;
189
412
  }>;
190
- declare type RoutesManifest = z.infer<typeof routesManifestSchema>;
191
- declare type RoutesManifestDynamicRoute = z.infer<typeof routesManifestDynamicRouteSchema>;
192
- declare type RoutesManifestDefault = Partial<Omit<RoutesManifest, 'version'>>;
413
+ declare type VercelOutputConfig = z.infer<typeof vercelOutputConfigSchema>;
193
414
 
194
- declare const functionsManifestSchema: z.ZodObject<{
195
- version: z.ZodLiteral<1>;
196
- pages: z.ZodIntersection<z.ZodObject<{
197
- '_middleware.js': z.ZodOptional<z.ZodObject<z.extendShape<{
198
- handler: z.ZodOptional<z.ZodString>;
199
- regions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
200
- maxDuration: z.ZodOptional<z.ZodNumber>;
201
- memory: z.ZodOptional<z.ZodNumber>;
202
- }, {
203
- runtime: z.ZodLiteral<"web">;
204
- env: z.ZodArray<z.ZodString, "many">;
205
- files: z.ZodArray<z.ZodString, "many">;
206
- name: z.ZodString;
207
- page: z.ZodString;
208
- regexp: z.ZodString;
209
- sortingIndex: z.ZodNumber;
210
- }>, "strict", z.ZodTypeAny, {
211
- handler?: string | undefined;
212
- regions?: string[] | undefined;
213
- maxDuration?: number | undefined;
214
- memory?: number | undefined;
215
- env: string[];
216
- page: string;
217
- runtime: "web";
218
- files: string[];
219
- name: string;
220
- regexp: string;
221
- sortingIndex: number;
222
- }, {
223
- handler?: string | undefined;
224
- regions?: string[] | undefined;
225
- maxDuration?: number | undefined;
226
- memory?: number | undefined;
227
- env: string[];
228
- page: string;
229
- runtime: "web";
230
- files: string[];
231
- name: string;
232
- regexp: string;
233
- sortingIndex: number;
234
- }>>;
235
- }, "strip", z.ZodTypeAny, {
236
- "_middleware.js"?: {
237
- handler?: string | undefined;
238
- regions?: string[] | undefined;
239
- maxDuration?: number | undefined;
240
- memory?: number | undefined;
241
- env: string[];
242
- page: string;
243
- runtime: "web";
244
- files: string[];
245
- name: string;
246
- regexp: string;
247
- sortingIndex: number;
248
- } | undefined;
249
- }, {
250
- "_middleware.js"?: {
251
- handler?: string | undefined;
252
- regions?: string[] | undefined;
253
- maxDuration?: number | undefined;
254
- memory?: number | undefined;
255
- env: string[];
256
- page: string;
257
- runtime: "web";
258
- files: string[];
259
- name: string;
260
- regexp: string;
261
- sortingIndex: number;
262
- } | undefined;
263
- }>, z.ZodRecord<z.ZodString, z.ZodIntersection<z.ZodObject<{
264
- env: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
265
- page: z.ZodOptional<z.ZodString>;
266
- handler: z.ZodOptional<z.ZodOptional<z.ZodString>>;
267
- regions: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
268
- maxDuration: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
269
- memory: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
270
- files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
271
- name: z.ZodOptional<z.ZodString>;
272
- regexp: z.ZodOptional<z.ZodString>;
273
- sortingIndex: z.ZodOptional<z.ZodNumber>;
274
- }, "strict", z.ZodTypeAny, {
275
- env?: string[] | undefined;
276
- page?: string | undefined;
277
- handler?: string | undefined;
278
- regions?: string[] | undefined;
279
- maxDuration?: number | undefined;
280
- memory?: number | undefined;
281
- files?: string[] | undefined;
282
- name?: string | undefined;
283
- regexp?: string | undefined;
284
- sortingIndex?: number | undefined;
285
- }, {
286
- env?: string[] | undefined;
287
- page?: string | undefined;
288
- handler?: string | undefined;
289
- regions?: string[] | undefined;
290
- maxDuration?: number | undefined;
291
- memory?: number | undefined;
292
- files?: string[] | undefined;
293
- name?: string | undefined;
294
- regexp?: string | undefined;
295
- sortingIndex?: number | undefined;
296
- }>, z.ZodObject<{
297
- runtime: z.ZodOptional<z.ZodString>;
298
- handler: z.ZodOptional<z.ZodString>;
299
- regions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
300
- maxDuration: z.ZodOptional<z.ZodNumber>;
301
- memory: z.ZodOptional<z.ZodNumber>;
302
- }, "strict", z.ZodTypeAny, {
303
- runtime?: string | undefined;
304
- handler?: string | undefined;
305
- regions?: string[] | undefined;
306
- maxDuration?: number | undefined;
307
- memory?: number | undefined;
308
- }, {
309
- runtime?: string | undefined;
310
- handler?: string | undefined;
311
- regions?: string[] | undefined;
312
- maxDuration?: number | undefined;
313
- memory?: number | undefined;
314
- }>>>>;
315
- }, "strip", z.ZodTypeAny, {
316
- version: 1;
317
- pages: {
318
- "_middleware.js"?: {
319
- handler?: string | undefined;
320
- regions?: string[] | undefined;
321
- maxDuration?: number | undefined;
322
- memory?: number | undefined;
323
- env: string[];
324
- page: string;
325
- runtime: "web";
326
- files: string[];
327
- name: string;
328
- regexp: string;
329
- sortingIndex: number;
330
- } | undefined;
331
- } & Record<string, {
332
- env?: string[] | undefined;
333
- page?: string | undefined;
334
- handler?: string | undefined;
335
- regions?: string[] | undefined;
336
- maxDuration?: number | undefined;
337
- memory?: number | undefined;
338
- files?: string[] | undefined;
339
- name?: string | undefined;
340
- regexp?: string | undefined;
341
- sortingIndex?: number | undefined;
342
- } & {
343
- runtime?: string | undefined;
344
- handler?: string | undefined;
345
- regions?: string[] | undefined;
346
- maxDuration?: number | undefined;
347
- memory?: number | undefined;
348
- }>;
349
- }, {
350
- version: 1;
351
- pages: {
352
- "_middleware.js"?: {
353
- handler?: string | undefined;
354
- regions?: string[] | undefined;
355
- maxDuration?: number | undefined;
356
- memory?: number | undefined;
357
- env: string[];
358
- page: string;
359
- runtime: "web";
360
- files: string[];
361
- name: string;
362
- regexp: string;
363
- sortingIndex: number;
364
- } | undefined;
365
- } & Record<string, {
366
- env?: string[] | undefined;
367
- page?: string | undefined;
368
- handler?: string | undefined;
369
- regions?: string[] | undefined;
370
- maxDuration?: number | undefined;
371
- memory?: number | undefined;
372
- files?: string[] | undefined;
373
- name?: string | undefined;
374
- regexp?: string | undefined;
375
- sortingIndex?: number | undefined;
376
- } & {
377
- runtime?: string | undefined;
378
- handler?: string | undefined;
379
- regions?: string[] | undefined;
380
- maxDuration?: number | undefined;
381
- memory?: number | undefined;
382
- }>;
383
- }>;
384
- declare type FunctionsManifest = z.infer<typeof functionsManifestSchema>;
415
+ /**
416
+ * Schema definition for `.vercel/output/config.json`
417
+ * @see {@link https://vercel.com/docs/build-output-api/v3#build-output-configuration}
418
+ */
385
419
 
386
- declare const prerenderManifestSchemaRoute: z.ZodObject<{
387
- initialRevalidateSeconds: z.ZodNumber;
388
- srcRoute: z.ZodString;
389
- dataRoute: z.ZodString;
420
+ declare const vercelOutputVcConfigSchema: z.ZodUnion<[z.ZodObject<{
421
+ runtime: z.ZodLiteral<"edge">;
422
+ entrypoint: z.ZodString;
423
+ envVarsInUse: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
390
424
  }, "strict", z.ZodTypeAny, {
391
- initialRevalidateSeconds: number;
392
- srcRoute: string;
393
- dataRoute: string;
425
+ envVarsInUse?: string[] | undefined;
426
+ runtime: "edge";
427
+ entrypoint: string;
394
428
  }, {
395
- initialRevalidateSeconds: number;
396
- srcRoute: string;
397
- dataRoute: string;
398
- }>;
399
- declare const prerenderManifestSchemaDynamicRoute: z.ZodObject<{
400
- routeRegex: z.ZodString;
401
- fallback: z.ZodUnion<[z.ZodString, z.ZodNull]>;
402
- dataRoute: z.ZodString;
403
- dataRouteRegex: z.ZodString;
429
+ envVarsInUse?: string[] | undefined;
430
+ runtime: "edge";
431
+ entrypoint: string;
432
+ }>, z.ZodObject<{
433
+ runtime: z.ZodString;
434
+ handler: z.ZodString;
435
+ memory: z.ZodOptional<z.ZodNumber>;
436
+ maxDuration: z.ZodOptional<z.ZodNumber>;
437
+ environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
438
+ regions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
404
439
  }, "strict", z.ZodTypeAny, {
405
- dataRoute: string;
406
- routeRegex: string;
407
- fallback: string | null;
408
- dataRouteRegex: string;
440
+ memory?: number | undefined;
441
+ maxDuration?: number | undefined;
442
+ environment?: Record<string, string> | undefined;
443
+ regions?: string[] | undefined;
444
+ runtime: string;
445
+ handler: string;
409
446
  }, {
410
- dataRoute: string;
411
- routeRegex: string;
412
- fallback: string | null;
413
- dataRouteRegex: string;
414
- }>;
415
- declare const prerenderManifestSchema: z.ZodObject<{
416
- version: z.ZodLiteral<3>;
417
- routes: z.ZodRecord<z.ZodString, z.ZodObject<{
418
- initialRevalidateSeconds: z.ZodNumber;
419
- srcRoute: z.ZodString;
420
- dataRoute: z.ZodString;
421
- }, "strict", z.ZodTypeAny, {
422
- initialRevalidateSeconds: number;
423
- srcRoute: string;
424
- dataRoute: string;
425
- }, {
426
- initialRevalidateSeconds: number;
427
- srcRoute: string;
428
- dataRoute: string;
429
- }>>;
430
- dynamicRoutes: z.ZodRecord<z.ZodString, z.ZodObject<{
431
- routeRegex: z.ZodString;
432
- fallback: z.ZodUnion<[z.ZodString, z.ZodNull]>;
433
- dataRoute: z.ZodString;
434
- dataRouteRegex: z.ZodString;
435
- }, "strict", z.ZodTypeAny, {
436
- dataRoute: string;
437
- routeRegex: string;
438
- fallback: string | null;
439
- dataRouteRegex: string;
440
- }, {
441
- dataRoute: string;
442
- routeRegex: string;
443
- fallback: string | null;
444
- dataRouteRegex: string;
445
- }>>;
446
- preview: z.ZodObject<{
447
- previewModeId: z.ZodUnion<[z.ZodString, z.ZodNull]>;
448
- }, "strict", z.ZodTypeAny, {
449
- previewModeId: string | null;
450
- }, {
451
- previewModeId: string | null;
452
- }>;
447
+ memory?: number | undefined;
448
+ maxDuration?: number | undefined;
449
+ environment?: Record<string, string> | undefined;
450
+ regions?: string[] | undefined;
451
+ runtime: string;
452
+ handler: string;
453
+ }>, z.ZodObject<z.extendShape<{
454
+ runtime: z.ZodString;
455
+ handler: z.ZodString;
456
+ memory: z.ZodOptional<z.ZodNumber>;
457
+ maxDuration: z.ZodOptional<z.ZodNumber>;
458
+ environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
459
+ regions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
460
+ }, {
461
+ launcherType: z.ZodLiteral<"Nodejs">;
462
+ shouldAddHelpers: z.ZodOptional<z.ZodBoolean>;
463
+ shouldAddSourcemapSupport: z.ZodOptional<z.ZodBoolean>;
464
+ awsLambdaHandler: z.ZodOptional<z.ZodString>;
465
+ }>, "strict", z.ZodTypeAny, {
466
+ memory?: number | undefined;
467
+ maxDuration?: number | undefined;
468
+ environment?: Record<string, string> | undefined;
469
+ regions?: string[] | undefined;
470
+ shouldAddHelpers?: boolean | undefined;
471
+ shouldAddSourcemapSupport?: boolean | undefined;
472
+ awsLambdaHandler?: string | undefined;
473
+ runtime: string;
474
+ handler: string;
475
+ launcherType: "Nodejs";
476
+ }, {
477
+ memory?: number | undefined;
478
+ maxDuration?: number | undefined;
479
+ environment?: Record<string, string> | undefined;
480
+ regions?: string[] | undefined;
481
+ shouldAddHelpers?: boolean | undefined;
482
+ shouldAddSourcemapSupport?: boolean | undefined;
483
+ awsLambdaHandler?: string | undefined;
484
+ runtime: string;
485
+ handler: string;
486
+ launcherType: "Nodejs";
487
+ }>]>;
488
+ declare type VercelOutputVcConfig = z.infer<typeof vercelOutputVcConfigSchema>;
489
+
490
+ /**
491
+ * Schema definition for `.vercel/output/config.json`
492
+ * @see {@link https://vercel.com/docs/build-output-api/v3#build-output-configuration}
493
+ */
494
+
495
+ declare const vercelOutputPrerenderConfigSchema: z.ZodObject<{
496
+ expiration: z.ZodUnion<[z.ZodNumber, z.ZodLiteral<false>]>;
497
+ group: z.ZodOptional<z.ZodNumber>;
498
+ bypassToken: z.ZodOptional<z.ZodString>;
499
+ fallback: z.ZodOptional<z.ZodString>;
500
+ allowQuery: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
453
501
  }, "strict", z.ZodTypeAny, {
454
- preview: {
455
- previewModeId: string | null;
456
- };
457
- version: 3;
458
- routes: Record<string, {
459
- initialRevalidateSeconds: number;
460
- srcRoute: string;
461
- dataRoute: string;
462
- }>;
463
- dynamicRoutes: Record<string, {
464
- dataRoute: string;
465
- routeRegex: string;
466
- fallback: string | null;
467
- dataRouteRegex: string;
468
- }>;
502
+ group?: number | undefined;
503
+ bypassToken?: string | undefined;
504
+ fallback?: string | undefined;
505
+ allowQuery?: string[] | undefined;
506
+ expiration: number | false;
469
507
  }, {
470
- preview: {
471
- previewModeId: string | null;
472
- };
473
- version: 3;
474
- routes: Record<string, {
475
- initialRevalidateSeconds: number;
476
- srcRoute: string;
477
- dataRoute: string;
478
- }>;
479
- dynamicRoutes: Record<string, {
480
- dataRoute: string;
481
- routeRegex: string;
482
- fallback: string | null;
483
- dataRouteRegex: string;
484
- }>;
508
+ group?: number | undefined;
509
+ bypassToken?: string | undefined;
510
+ fallback?: string | undefined;
511
+ allowQuery?: string[] | undefined;
512
+ expiration: number | false;
485
513
  }>;
486
- declare type PrerenderManifest = z.infer<typeof prerenderManifestSchema>;
487
- declare type PrerenderManifestRoute = z.infer<typeof prerenderManifestSchemaRoute>;
488
- declare type PrerenderManifestDynamicRoute = z.infer<typeof prerenderManifestSchemaDynamicRoute>;
489
- declare type DeepPartial<T> = T extends Function ? T : T extends object ? {
490
- [P in keyof T]?: DeepPartial<T[P]>;
491
- } : T;
492
- declare type PrerenderManifestDefault = DeepPartial<PrerenderManifest>;
514
+ declare type VercelOutputPrerenderConfig = z.infer<typeof vercelOutputPrerenderConfigSchema>;
493
515
 
494
516
  interface ViteVercelConfig {
495
517
  /**
@@ -498,32 +520,21 @@ interface ViteVercelConfig {
498
520
  */
499
521
  defaultMaxDuration?: number;
500
522
  /**
501
- * If ISR is supported, default revalidation time per-page can be overriden.
502
- * A `prerender` function is necessary for ISR to work.
523
+ * Default expiration time (in seconds) for prerender functions.
503
524
  * Defaults to 86400 seconds (24h).
504
525
  * @see {@link https://vercel.com/docs/concepts/next.js/incremental-static-regeneration}
526
+ * @see {@link https://vercel.com/docs/build-output-api/v3#vercel-primitives/prerender-functions/configuration}
505
527
  */
506
- initialRevalidateSeconds?: number;
528
+ expiration?: number;
507
529
  /**
508
530
  * Also known as Server Side Generation, or SSG.
509
- * If present, must build static files in `.output/server/pages`.
531
+ * If present, must build static files in `.vercel/output/static`.
510
532
  * Can be set to `false` to disable prerendering completely.
511
533
  */
512
534
  prerender?: ViteVercelPrerenderFn | false;
513
535
  /**
514
- * By default, all `api/*` endpoints are compiled under `.ouput/server/pages/api`.
515
- * If a file must also be compiled only under `.ouput/server/pages`, it should be added here.
516
- *
517
- * @example
518
- * ```
519
- * {
520
- * pagesEndpoints: ['./api/page.ts']
521
- * }
522
- * ```
523
- */
524
- pagesEndpoints?: string[];
525
- /**
526
- * All provided endpoints will also be part of the build process.
536
+ * By default, all `api/*` endpoints are compiled under `.vercel/output/functions/api/*.func`.
537
+ * If others serverless functions need to be compiled under `.vercel/output/functions`, they should be added here.
527
538
  * For instance, a framework can leverage this to have a generic ssr endpoint
528
539
  * without requiring the user to write any code.
529
540
  *
@@ -534,8 +545,8 @@ interface ViteVercelConfig {
534
545
  * {
535
546
  * // can also be an Object representing an esbuild StdinOptions
536
547
  * source: '/path/to/file.ts',
537
- * // relative to `.output/server/pages`, without extension
538
- * destination: ['file', '/api/file'],
548
+ * // URL path of the handler, will be generated to `.vercel/output/functions/api/file.func/index.js`
549
+ * destination: '/api/file',
539
550
  * }
540
551
  * ]
541
552
  * }
@@ -543,33 +554,46 @@ interface ViteVercelConfig {
543
554
  */
544
555
  additionalEndpoints?: ViteVercelApiEntry[];
545
556
  /**
546
- * Advanced configuration to override funtions-manifest.json
547
- * @see {@link https://vercel.com/docs/file-system-api#configuration/functions}
548
- * @protected
549
- */
550
- functionsManifest?: Partial<Omit<FunctionsManifest, 'version'>>;
551
- /**
552
- * Advanced configuration to override routes-manifest.json
553
- * @see {@link https://vercel.com/docs/file-system-api#configuration/routes}
557
+ * Advanced configuration to override .vercel/output/config.json
558
+ * @see {@link https://vercel.com/docs/build-output-api/v3#build-output-configuration}
554
559
  * @protected
555
560
  */
556
- routesManifest?: RoutesManifestDefault;
561
+ config?: Partial<Omit<VercelOutputConfig, 'version'>>;
557
562
  /**
558
- * Advanced configuration to override prerender-manifest.json
559
- * @see {@link https://vercel.com/docs/file-system-api#configuration/pre-rendering}
563
+ * ISR and SSG pages are mutually exclusive. If a page is found in both, ISR prevails.
564
+ * Keys are path relative to .vercel/output/functions directory, either without extension,
565
+ * or with `.prerender-config.json` extension.
566
+ * If you have multiple isr configurations pointing to the same underlying function, you can leverage the `symlink`
567
+ * property. See example below.
568
+ *
569
+ * @example
570
+ * ```
571
+ * // Here `ssr_` means that a function is available under `.vercel/output/functions/ssr_.func`
572
+ * isr: {
573
+ * '/pages/a': { expiration: 15, symlink: 'ssr_', route: '^/a/.*$' },
574
+ * '/pages/b/c': { expiration: 15, symlink: 'ssr_', route: '^/b/c/.*$' },
575
+ * '/pages/d': { expiration: 15, symlink: 'ssr_', route: '^/d$' },
576
+ * '/pages/e': { expiration: 25 }
577
+ * }
578
+ * ```
579
+ *
560
580
  * @protected
561
581
  */
562
- prerenderManifest?: PrerenderManifestDefault;
582
+ isr?: Record<string, VercelOutputIsr> | (() => Promise<Record<string, VercelOutputIsr>> | Record<string, VercelOutputIsr>);
563
583
  /**
564
- * Defaults to `.output`. Mostly useful for testing prupose
584
+ * Defaults to `.vercel/output`. Mostly useful for testing prupose
565
585
  * @protected
566
586
  */
567
587
  outDir?: string;
568
588
  }
569
- declare type ViteVercelPrerenderRoute = {
570
- isr?: Pick<PrerenderManifestDefault, 'routes' | 'dynamicRoutes'>;
571
- ssr?: Pick<RoutesManifestDefault, 'rewrites' | 'dynamicRoutes' | 'headers'>;
572
- };
589
+ interface VercelOutputIsr extends VercelOutputPrerenderConfig {
590
+ symlink?: string;
591
+ route?: string;
592
+ }
593
+ /**
594
+ * Keys are path relative to .vercel/output/static directory
595
+ */
596
+ declare type ViteVercelPrerenderRoute = VercelOutputConfig['overrides'];
573
597
  declare type ViteVercelPrerenderFn = (resolvedConfig: ResolvedConfig) => ViteVercelPrerenderRoute | Promise<ViteVercelPrerenderRoute>;
574
598
  interface ViteVercelApiEntry {
575
599
  /**
@@ -577,9 +601,9 @@ interface ViteVercelApiEntry {
577
601
  */
578
602
  source: string | StdinOptions;
579
603
  /**
580
- * Relative to `.output/server/pages`, without extension
604
+ * Relative to `.vercel/output/functions`, without extension
581
605
  */
582
- destination: string | string[];
606
+ destination: string;
583
607
  /**
584
608
  * Override esbuild options
585
609
  */
@@ -588,4 +612,4 @@ interface ViteVercelApiEntry {
588
612
 
589
613
  declare function allPlugins(): Plugin[];
590
614
 
591
- export { FunctionsManifest, PrerenderManifest, PrerenderManifestDefault, PrerenderManifestDynamicRoute, PrerenderManifestRoute, RoutesManifest, RoutesManifestDefault, RoutesManifestDynamicRoute, ViteVercelApiEntry, ViteVercelConfig, ViteVercelPrerenderFn, ViteVercelPrerenderRoute, allPlugins as default };
615
+ export { VercelOutputConfig, VercelOutputIsr, VercelOutputPrerenderConfig, VercelOutputVcConfig, ViteVercelApiEntry, ViteVercelConfig, ViteVercelPrerenderFn, ViteVercelPrerenderRoute, allPlugins as default };