vite-plugin-vercel 0.0.2 → 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.cjs +424 -0
- package/dist/index.d.ts +546 -144
- package/dist/index.js +277 -297
- package/package.json +19 -18
- package/dist/index.mjs +0 -393
package/dist/index.d.ts
CHANGED
|
@@ -1,117 +1,517 @@
|
|
|
1
1
|
import { ResolvedConfig, Plugin } from 'vite';
|
|
2
2
|
import { StdinOptions, BuildOptions } from 'esbuild';
|
|
3
|
-
import
|
|
4
|
-
import * as myzod from 'myzod';
|
|
3
|
+
import { z } from 'zod';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
value:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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<{
|
|
11
|
+
version: z.ZodLiteral<3>;
|
|
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">;
|
|
22
|
+
value: z.ZodString;
|
|
23
|
+
}, "strict", z.ZodTypeAny, {
|
|
24
|
+
value: string;
|
|
25
|
+
type: "host";
|
|
26
|
+
}, {
|
|
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";
|
|
36
|
+
key: string;
|
|
37
|
+
}, {
|
|
38
|
+
value?: string | undefined;
|
|
39
|
+
type: "header";
|
|
40
|
+
key: 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";
|
|
48
|
+
key: string;
|
|
49
|
+
}, {
|
|
50
|
+
value?: string | undefined;
|
|
51
|
+
type: "cookie";
|
|
52
|
+
key: string;
|
|
53
|
+
}>, z.ZodObject<{
|
|
54
|
+
type: z.ZodLiteral<"query">;
|
|
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">;
|
|
68
|
+
value: z.ZodString;
|
|
69
|
+
}, "strict", z.ZodTypeAny, {
|
|
70
|
+
value: string;
|
|
71
|
+
type: "host";
|
|
72
|
+
}, {
|
|
73
|
+
value: string;
|
|
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";
|
|
94
|
+
key: string;
|
|
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;
|
|
47
121
|
}>>;
|
|
48
|
-
|
|
122
|
+
middlewarePath: z.ZodOptional<z.ZodString>;
|
|
123
|
+
}, "strict", z.ZodTypeAny, {
|
|
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?: ({
|
|
147
|
+
value: string;
|
|
148
|
+
type: "host";
|
|
149
|
+
} | {
|
|
150
|
+
value?: string | undefined;
|
|
151
|
+
type: "header";
|
|
152
|
+
key: string;
|
|
153
|
+
} | {
|
|
154
|
+
value?: string | undefined;
|
|
155
|
+
type: "cookie";
|
|
156
|
+
key: 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;
|
|
168
|
+
}, {
|
|
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?: ({
|
|
176
|
+
value: string;
|
|
177
|
+
type: "host";
|
|
178
|
+
} | {
|
|
179
|
+
value?: string | undefined;
|
|
180
|
+
type: "header";
|
|
181
|
+
key: string;
|
|
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;
|
|
254
|
+
}, "strict", z.ZodTypeAny, {
|
|
255
|
+
value: string;
|
|
256
|
+
domain: string;
|
|
257
|
+
}, {
|
|
258
|
+
value: string;
|
|
259
|
+
domain: string;
|
|
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;
|
|
49
270
|
}>>>;
|
|
271
|
+
cache: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
272
|
+
}, "strict", z.ZodTypeAny, {
|
|
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?: ({
|
|
281
|
+
value: string;
|
|
282
|
+
type: "host";
|
|
283
|
+
} | {
|
|
284
|
+
value?: string | undefined;
|
|
285
|
+
type: "header";
|
|
286
|
+
key: string;
|
|
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?: ({
|
|
297
|
+
value: string;
|
|
298
|
+
type: "host";
|
|
299
|
+
} | {
|
|
300
|
+
value?: string | undefined;
|
|
301
|
+
type: "header";
|
|
302
|
+
key: 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;
|
|
335
|
+
}[] | undefined;
|
|
336
|
+
overrides?: Record<string, {
|
|
337
|
+
path?: string | undefined;
|
|
338
|
+
contentType?: string | undefined;
|
|
339
|
+
}> | undefined;
|
|
340
|
+
cache?: string[] | undefined;
|
|
341
|
+
version: 3;
|
|
342
|
+
}, {
|
|
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?: ({
|
|
351
|
+
value: string;
|
|
352
|
+
type: "host";
|
|
353
|
+
} | {
|
|
354
|
+
value?: string | undefined;
|
|
355
|
+
type: "header";
|
|
356
|
+
key: string;
|
|
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?: ({
|
|
367
|
+
value: string;
|
|
368
|
+
type: "host";
|
|
369
|
+
} | {
|
|
370
|
+
value?: string | undefined;
|
|
371
|
+
type: "header";
|
|
372
|
+
key: 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;
|
|
405
|
+
}[] | undefined;
|
|
406
|
+
overrides?: Record<string, {
|
|
407
|
+
path?: string | undefined;
|
|
408
|
+
contentType?: string | undefined;
|
|
409
|
+
}> | undefined;
|
|
410
|
+
cache?: string[] | undefined;
|
|
411
|
+
version: 3;
|
|
50
412
|
}>;
|
|
51
|
-
declare type
|
|
52
|
-
declare type RoutesManifestDynamicRoute = myzod.Infer<typeof routesManifestDynamicRouteSchema>;
|
|
53
|
-
declare type RoutesManifestDefault = Partial<Omit<RoutesManifest, 'version'>>;
|
|
413
|
+
declare type VercelOutputConfig = z.infer<typeof vercelOutputConfigSchema>;
|
|
54
414
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
handler: myzod.OptionalType<myzod.StringType>;
|
|
60
|
-
regions: myzod.OptionalType<myzod.ArrayType<myzod.StringType>>;
|
|
61
|
-
maxDuration: myzod.OptionalType<myzod.NumberType>;
|
|
62
|
-
memory: myzod.OptionalType<myzod.NumberType>;
|
|
63
|
-
runtime: myzod_libs_types.LiteralType<"web">;
|
|
64
|
-
env: myzod.ArrayType<myzod.StringType>;
|
|
65
|
-
files: myzod.ArrayType<myzod.StringType>;
|
|
66
|
-
name: myzod.StringType;
|
|
67
|
-
page: myzod.StringType;
|
|
68
|
-
regexp: myzod.StringType;
|
|
69
|
-
sortingIndex: myzod.NumberType;
|
|
70
|
-
}>>;
|
|
71
|
-
[myzod.keySignature]: myzod.AnyType;
|
|
72
|
-
}>;
|
|
73
|
-
}>;
|
|
74
|
-
declare type FunctionsManifest = myzod.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
|
+
*/
|
|
75
419
|
|
|
76
|
-
declare const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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">>;
|
|
424
|
+
}, "strict", z.ZodTypeAny, {
|
|
425
|
+
envVarsInUse?: string[] | undefined;
|
|
426
|
+
runtime: "edge";
|
|
427
|
+
entrypoint: string;
|
|
428
|
+
}, {
|
|
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">>;
|
|
439
|
+
}, "strict", z.ZodTypeAny, {
|
|
440
|
+
memory?: number | undefined;
|
|
441
|
+
maxDuration?: number | undefined;
|
|
442
|
+
environment?: Record<string, string> | undefined;
|
|
443
|
+
regions?: string[] | undefined;
|
|
444
|
+
runtime: string;
|
|
445
|
+
handler: string;
|
|
446
|
+
}, {
|
|
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">>;
|
|
501
|
+
}, "strict", z.ZodTypeAny, {
|
|
502
|
+
group?: number | undefined;
|
|
503
|
+
bypassToken?: string | undefined;
|
|
504
|
+
fallback?: string | undefined;
|
|
505
|
+
allowQuery?: string[] | undefined;
|
|
506
|
+
expiration: number | false;
|
|
507
|
+
}, {
|
|
508
|
+
group?: number | undefined;
|
|
509
|
+
bypassToken?: string | undefined;
|
|
510
|
+
fallback?: string | undefined;
|
|
511
|
+
allowQuery?: string[] | undefined;
|
|
512
|
+
expiration: number | false;
|
|
107
513
|
}>;
|
|
108
|
-
declare type
|
|
109
|
-
declare type PrerenderManifestRoute = myzod.Infer<typeof prerenderManifestSchemaRoute>;
|
|
110
|
-
declare type PrerenderManifestDynamicRoute = myzod.Infer<typeof prerenderManifestSchemaDynamicRoute>;
|
|
111
|
-
declare type DeepPartial<T> = T extends Function ? T : T extends object ? {
|
|
112
|
-
[P in keyof T]?: DeepPartial<T[P]>;
|
|
113
|
-
} : T;
|
|
114
|
-
declare type PrerenderManifestDefault = DeepPartial<PrerenderManifest>;
|
|
514
|
+
declare type VercelOutputPrerenderConfig = z.infer<typeof vercelOutputPrerenderConfigSchema>;
|
|
115
515
|
|
|
116
516
|
interface ViteVercelConfig {
|
|
117
517
|
/**
|
|
@@ -120,32 +520,21 @@ interface ViteVercelConfig {
|
|
|
120
520
|
*/
|
|
121
521
|
defaultMaxDuration?: number;
|
|
122
522
|
/**
|
|
123
|
-
*
|
|
124
|
-
* A `prerender` function is necessary for ISR to work.
|
|
523
|
+
* Default expiration time (in seconds) for prerender functions.
|
|
125
524
|
* Defaults to 86400 seconds (24h).
|
|
126
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}
|
|
127
527
|
*/
|
|
128
|
-
|
|
528
|
+
expiration?: number;
|
|
129
529
|
/**
|
|
130
530
|
* Also known as Server Side Generation, or SSG.
|
|
131
|
-
* If present, must build static files in `.output/
|
|
531
|
+
* If present, must build static files in `.vercel/output/static`.
|
|
132
532
|
* Can be set to `false` to disable prerendering completely.
|
|
133
533
|
*/
|
|
134
534
|
prerender?: ViteVercelPrerenderFn | false;
|
|
135
535
|
/**
|
|
136
|
-
* By default, all `api/*` endpoints are compiled under `.
|
|
137
|
-
* If
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
140
|
-
* ```
|
|
141
|
-
* {
|
|
142
|
-
* pagesEndpoints: ['./api/page.ts']
|
|
143
|
-
* }
|
|
144
|
-
* ```
|
|
145
|
-
*/
|
|
146
|
-
pagesEndpoints?: string[];
|
|
147
|
-
/**
|
|
148
|
-
* 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.
|
|
149
538
|
* For instance, a framework can leverage this to have a generic ssr endpoint
|
|
150
539
|
* without requiring the user to write any code.
|
|
151
540
|
*
|
|
@@ -156,8 +545,8 @@ interface ViteVercelConfig {
|
|
|
156
545
|
* {
|
|
157
546
|
* // can also be an Object representing an esbuild StdinOptions
|
|
158
547
|
* source: '/path/to/file.ts',
|
|
159
|
-
* //
|
|
160
|
-
* destination:
|
|
548
|
+
* // URL path of the handler, will be generated to `.vercel/output/functions/api/file.func/index.js`
|
|
549
|
+
* destination: '/api/file',
|
|
161
550
|
* }
|
|
162
551
|
* ]
|
|
163
552
|
* }
|
|
@@ -165,33 +554,46 @@ interface ViteVercelConfig {
|
|
|
165
554
|
*/
|
|
166
555
|
additionalEndpoints?: ViteVercelApiEntry[];
|
|
167
556
|
/**
|
|
168
|
-
* Advanced configuration to override
|
|
169
|
-
* @see {@link https://vercel.com/docs/
|
|
170
|
-
* @protected
|
|
171
|
-
*/
|
|
172
|
-
functionsManifest?: Partial<Omit<FunctionsManifest, 'version'>>;
|
|
173
|
-
/**
|
|
174
|
-
* Advanced configuration to override routes-manifest.json
|
|
175
|
-
* @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}
|
|
176
559
|
* @protected
|
|
177
560
|
*/
|
|
178
|
-
|
|
561
|
+
config?: Partial<Omit<VercelOutputConfig, 'version'>>;
|
|
179
562
|
/**
|
|
180
|
-
*
|
|
181
|
-
*
|
|
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
|
+
*
|
|
182
580
|
* @protected
|
|
183
581
|
*/
|
|
184
|
-
|
|
582
|
+
isr?: Record<string, VercelOutputIsr> | (() => Promise<Record<string, VercelOutputIsr>> | Record<string, VercelOutputIsr>);
|
|
185
583
|
/**
|
|
186
|
-
* Defaults to `.output`. Mostly useful for testing prupose
|
|
584
|
+
* Defaults to `.vercel/output`. Mostly useful for testing prupose
|
|
187
585
|
* @protected
|
|
188
586
|
*/
|
|
189
587
|
outDir?: string;
|
|
190
588
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
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'];
|
|
195
597
|
declare type ViteVercelPrerenderFn = (resolvedConfig: ResolvedConfig) => ViteVercelPrerenderRoute | Promise<ViteVercelPrerenderRoute>;
|
|
196
598
|
interface ViteVercelApiEntry {
|
|
197
599
|
/**
|
|
@@ -199,9 +601,9 @@ interface ViteVercelApiEntry {
|
|
|
199
601
|
*/
|
|
200
602
|
source: string | StdinOptions;
|
|
201
603
|
/**
|
|
202
|
-
* Relative to `.output/
|
|
604
|
+
* Relative to `.vercel/output/functions`, without extension
|
|
203
605
|
*/
|
|
204
|
-
destination: string
|
|
606
|
+
destination: string;
|
|
205
607
|
/**
|
|
206
608
|
* Override esbuild options
|
|
207
609
|
*/
|
|
@@ -210,4 +612,4 @@ interface ViteVercelApiEntry {
|
|
|
210
612
|
|
|
211
613
|
declare function allPlugins(): Plugin[];
|
|
212
614
|
|
|
213
|
-
export {
|
|
615
|
+
export { VercelOutputConfig, VercelOutputIsr, VercelOutputPrerenderConfig, VercelOutputVcConfig, ViteVercelApiEntry, ViteVercelConfig, ViteVercelPrerenderFn, ViteVercelPrerenderRoute, allPlugins as default };
|