vite-plugin-vercel 10.0.0 → 11.0.0-beta.2

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
@@ -1,694 +1,25 @@
1
- import { ResolvedConfig, PluginOption } from 'vite';
2
- import { Rewrite, Redirect, Header } from '@vercel/routing-utils';
3
- import { StdinOptions, BuildOptions } from 'esbuild';
4
- import { z } from 'zod';
1
+ import { EntryMeta } from "@universal-deploy/store";
5
2
 
6
- /**
7
- * Schema definition for `.vercel/output/config.json`
8
- * @see {@link https://vercel.com/docs/build-output-api/v3#build-output-configuration}
9
- */
10
-
11
- declare const vercelOutputConfigSchema: z.ZodObject<{
12
- version: z.ZodLiteral<3>;
13
- routes: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
14
- src: z.ZodString;
15
- dest: z.ZodOptional<z.ZodString>;
16
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
17
- methods: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
18
- status: z.ZodOptional<z.ZodNumber>;
19
- continue: z.ZodOptional<z.ZodBoolean>;
20
- check: z.ZodOptional<z.ZodBoolean>;
21
- missing: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
22
- type: z.ZodLiteral<"host">;
23
- value: z.ZodString;
24
- }, "strict", z.ZodTypeAny, {
25
- value: string;
26
- type: "host";
27
- }, {
28
- value: string;
29
- type: "host";
30
- }>, z.ZodObject<{
31
- type: z.ZodLiteral<"header">;
32
- key: z.ZodString;
33
- value: z.ZodOptional<z.ZodString>;
34
- }, "strict", z.ZodTypeAny, {
35
- type: "header";
36
- key: string;
37
- value?: string | undefined;
38
- }, {
39
- type: "header";
40
- key: string;
41
- value?: string | undefined;
42
- }>, z.ZodObject<{
43
- type: z.ZodLiteral<"cookie">;
44
- key: z.ZodString;
45
- value: z.ZodOptional<z.ZodString>;
46
- }, "strict", z.ZodTypeAny, {
47
- type: "cookie";
48
- key: string;
49
- value?: string | undefined;
50
- }, {
51
- type: "cookie";
52
- key: string;
53
- value?: string | undefined;
54
- }>, z.ZodObject<{
55
- type: z.ZodLiteral<"query">;
56
- key: z.ZodString;
57
- value: z.ZodOptional<z.ZodString>;
58
- }, "strict", z.ZodTypeAny, {
59
- type: "query";
60
- key: string;
61
- value?: string | undefined;
62
- }, {
63
- type: "query";
64
- key: string;
65
- value?: string | undefined;
66
- }>]>, "many">>;
67
- has: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
68
- type: z.ZodLiteral<"host">;
69
- value: z.ZodString;
70
- }, "strict", z.ZodTypeAny, {
71
- value: string;
72
- type: "host";
73
- }, {
74
- value: string;
75
- type: "host";
76
- }>, z.ZodObject<{
77
- type: z.ZodLiteral<"header">;
78
- key: z.ZodString;
79
- value: z.ZodOptional<z.ZodString>;
80
- }, "strict", z.ZodTypeAny, {
81
- type: "header";
82
- key: string;
83
- value?: string | undefined;
84
- }, {
85
- type: "header";
86
- key: string;
87
- value?: string | undefined;
88
- }>, z.ZodObject<{
89
- type: z.ZodLiteral<"cookie">;
90
- key: z.ZodString;
91
- value: z.ZodOptional<z.ZodString>;
92
- }, "strict", z.ZodTypeAny, {
93
- type: "cookie";
94
- key: string;
95
- value?: string | undefined;
96
- }, {
97
- type: "cookie";
98
- key: string;
99
- value?: string | undefined;
100
- }>, z.ZodObject<{
101
- type: z.ZodLiteral<"query">;
102
- key: z.ZodString;
103
- value: z.ZodOptional<z.ZodString>;
104
- }, "strict", z.ZodTypeAny, {
105
- type: "query";
106
- key: string;
107
- value?: string | undefined;
108
- }, {
109
- type: "query";
110
- key: string;
111
- value?: string | undefined;
112
- }>]>, "many">>;
113
- locale: z.ZodOptional<z.ZodObject<{
114
- redirect: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
115
- cookie: z.ZodOptional<z.ZodString>;
116
- }, "strict", z.ZodTypeAny, {
117
- cookie?: string | undefined;
118
- redirect?: Record<string, string> | undefined;
119
- }, {
120
- cookie?: string | undefined;
121
- redirect?: Record<string, string> | undefined;
122
- }>>;
123
- middlewarePath: z.ZodOptional<z.ZodString>;
124
- }, "strict", z.ZodTypeAny, {
125
- src: string;
126
- status?: number | undefined;
127
- dest?: string | undefined;
128
- headers?: Record<string, string> | undefined;
129
- methods?: string[] | undefined;
130
- continue?: boolean | undefined;
131
- check?: boolean | undefined;
132
- missing?: ({
133
- value: string;
134
- type: "host";
135
- } | {
136
- type: "header";
137
- key: string;
138
- value?: string | undefined;
139
- } | {
140
- type: "cookie";
141
- key: string;
142
- value?: string | undefined;
143
- } | {
144
- type: "query";
145
- key: string;
146
- value?: string | undefined;
147
- })[] | undefined;
148
- has?: ({
149
- value: string;
150
- type: "host";
151
- } | {
152
- type: "header";
153
- key: string;
154
- value?: string | undefined;
155
- } | {
156
- type: "cookie";
157
- key: string;
158
- value?: string | undefined;
159
- } | {
160
- type: "query";
161
- key: string;
162
- value?: string | undefined;
163
- })[] | undefined;
164
- locale?: {
165
- cookie?: string | undefined;
166
- redirect?: Record<string, string> | undefined;
167
- } | undefined;
168
- middlewarePath?: string | undefined;
169
- }, {
170
- src: string;
171
- status?: number | undefined;
172
- dest?: string | undefined;
173
- headers?: Record<string, string> | undefined;
174
- methods?: string[] | undefined;
175
- continue?: boolean | undefined;
176
- check?: boolean | undefined;
177
- missing?: ({
178
- value: string;
179
- type: "host";
180
- } | {
181
- type: "header";
182
- key: string;
183
- value?: string | undefined;
184
- } | {
185
- type: "cookie";
186
- key: string;
187
- value?: string | undefined;
188
- } | {
189
- type: "query";
190
- key: string;
191
- value?: string | undefined;
192
- })[] | undefined;
193
- has?: ({
194
- value: string;
195
- type: "host";
196
- } | {
197
- type: "header";
198
- key: string;
199
- value?: string | undefined;
200
- } | {
201
- type: "cookie";
202
- key: string;
203
- value?: string | undefined;
204
- } | {
205
- type: "query";
206
- key: string;
207
- value?: string | undefined;
208
- })[] | undefined;
209
- locale?: {
210
- cookie?: string | undefined;
211
- redirect?: Record<string, string> | undefined;
212
- } | undefined;
213
- middlewarePath?: string | undefined;
214
- }>, z.ZodObject<{
215
- handle: z.ZodUnion<[z.ZodLiteral<"rewrite">, z.ZodLiteral<"filesystem">, z.ZodLiteral<"resource">, z.ZodLiteral<"miss">, z.ZodLiteral<"hit">, z.ZodLiteral<"error">]>;
216
- src: z.ZodOptional<z.ZodString>;
217
- dest: z.ZodOptional<z.ZodString>;
218
- status: z.ZodOptional<z.ZodNumber>;
219
- }, "strict", z.ZodTypeAny, {
220
- handle: "rewrite" | "filesystem" | "resource" | "miss" | "hit" | "error";
221
- status?: number | undefined;
222
- src?: string | undefined;
223
- dest?: string | undefined;
224
- }, {
225
- handle: "rewrite" | "filesystem" | "resource" | "miss" | "hit" | "error";
226
- status?: number | undefined;
227
- src?: string | undefined;
228
- dest?: string | undefined;
229
- }>]>, "many">>;
230
- images: z.ZodOptional<z.ZodObject<{
231
- sizes: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
232
- domains: z.ZodOptional<z.ZodArray<z.ZodString, "atleastone">>;
233
- minimumCacheTTL: z.ZodOptional<z.ZodNumber>;
234
- formats: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"image/avif">, z.ZodLiteral<"image/webp">]>, "atleastone">>;
235
- dangerouslyAllowSVG: z.ZodOptional<z.ZodBoolean>;
236
- contentSecurityPolicy: z.ZodOptional<z.ZodString>;
237
- }, "strict", z.ZodTypeAny, {
238
- sizes: [number, number];
239
- domains?: [string, ...string[]] | undefined;
240
- minimumCacheTTL?: number | undefined;
241
- formats?: ["image/avif" | "image/webp", ...("image/avif" | "image/webp")[]] | undefined;
242
- dangerouslyAllowSVG?: boolean | undefined;
243
- contentSecurityPolicy?: string | undefined;
244
- }, {
245
- sizes: [number, number];
246
- domains?: [string, ...string[]] | undefined;
247
- minimumCacheTTL?: number | undefined;
248
- formats?: ["image/avif" | "image/webp", ...("image/avif" | "image/webp")[]] | undefined;
249
- dangerouslyAllowSVG?: boolean | undefined;
250
- contentSecurityPolicy?: string | undefined;
251
- }>>;
252
- wildcard: z.ZodOptional<z.ZodArray<z.ZodObject<{
253
- domain: z.ZodString;
254
- value: z.ZodString;
255
- }, "strict", z.ZodTypeAny, {
256
- value: string;
257
- domain: string;
258
- }, {
259
- value: string;
260
- domain: string;
261
- }>, "many">>;
262
- overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
263
- path: z.ZodOptional<z.ZodString>;
264
- contentType: z.ZodOptional<z.ZodString>;
265
- }, "strict", z.ZodTypeAny, {
266
- path?: string | undefined;
267
- contentType?: string | undefined;
268
- }, {
269
- path?: string | undefined;
270
- contentType?: string | undefined;
271
- }>>>;
272
- cache: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
273
- }, "strict", z.ZodTypeAny, {
274
- version: 3;
275
- routes?: ({
276
- src: string;
277
- status?: number | undefined;
278
- dest?: string | undefined;
279
- headers?: Record<string, string> | undefined;
280
- methods?: string[] | undefined;
281
- continue?: boolean | undefined;
282
- check?: boolean | undefined;
283
- missing?: ({
284
- value: string;
285
- type: "host";
286
- } | {
287
- type: "header";
288
- key: string;
289
- value?: string | undefined;
290
- } | {
291
- type: "cookie";
292
- key: string;
293
- value?: string | undefined;
294
- } | {
295
- type: "query";
296
- key: string;
297
- value?: string | undefined;
298
- })[] | undefined;
299
- has?: ({
300
- value: string;
301
- type: "host";
302
- } | {
303
- type: "header";
304
- key: string;
305
- value?: string | undefined;
306
- } | {
307
- type: "cookie";
308
- key: string;
309
- value?: string | undefined;
310
- } | {
311
- type: "query";
312
- key: string;
313
- value?: string | undefined;
314
- })[] | undefined;
315
- locale?: {
316
- cookie?: string | undefined;
317
- redirect?: Record<string, string> | undefined;
318
- } | undefined;
319
- middlewarePath?: string | undefined;
320
- } | {
321
- handle: "rewrite" | "filesystem" | "resource" | "miss" | "hit" | "error";
322
- status?: number | undefined;
323
- src?: string | undefined;
324
- dest?: string | undefined;
325
- })[] | undefined;
326
- images?: {
327
- sizes: [number, number];
328
- domains?: [string, ...string[]] | undefined;
329
- minimumCacheTTL?: number | undefined;
330
- formats?: ["image/avif" | "image/webp", ...("image/avif" | "image/webp")[]] | undefined;
331
- dangerouslyAllowSVG?: boolean | undefined;
332
- contentSecurityPolicy?: string | undefined;
333
- } | undefined;
334
- wildcard?: {
335
- value: string;
336
- domain: string;
337
- }[] | undefined;
338
- overrides?: Record<string, {
339
- path?: string | undefined;
340
- contentType?: string | undefined;
341
- }> | undefined;
342
- cache?: string[] | undefined;
343
- }, {
344
- version: 3;
345
- routes?: ({
346
- src: string;
347
- status?: number | undefined;
348
- dest?: string | undefined;
349
- headers?: Record<string, string> | undefined;
350
- methods?: string[] | undefined;
351
- continue?: boolean | undefined;
352
- check?: boolean | undefined;
353
- missing?: ({
354
- value: string;
355
- type: "host";
356
- } | {
357
- type: "header";
358
- key: string;
359
- value?: string | undefined;
360
- } | {
361
- type: "cookie";
362
- key: string;
363
- value?: string | undefined;
364
- } | {
365
- type: "query";
366
- key: string;
367
- value?: string | undefined;
368
- })[] | undefined;
369
- has?: ({
370
- value: string;
371
- type: "host";
372
- } | {
373
- type: "header";
374
- key: string;
375
- value?: string | undefined;
376
- } | {
377
- type: "cookie";
378
- key: string;
379
- value?: string | undefined;
380
- } | {
381
- type: "query";
382
- key: string;
383
- value?: string | undefined;
384
- })[] | undefined;
385
- locale?: {
386
- cookie?: string | undefined;
387
- redirect?: Record<string, string> | undefined;
388
- } | undefined;
389
- middlewarePath?: string | undefined;
390
- } | {
391
- handle: "rewrite" | "filesystem" | "resource" | "miss" | "hit" | "error";
392
- status?: number | undefined;
393
- src?: string | undefined;
394
- dest?: string | undefined;
395
- })[] | undefined;
396
- images?: {
397
- sizes: [number, number];
398
- domains?: [string, ...string[]] | undefined;
399
- minimumCacheTTL?: number | undefined;
400
- formats?: ["image/avif" | "image/webp", ...("image/avif" | "image/webp")[]] | undefined;
401
- dangerouslyAllowSVG?: boolean | undefined;
402
- contentSecurityPolicy?: string | undefined;
403
- } | undefined;
404
- wildcard?: {
405
- value: string;
406
- domain: string;
407
- }[] | undefined;
408
- overrides?: Record<string, {
409
- path?: string | undefined;
410
- contentType?: string | undefined;
411
- }> | undefined;
412
- cache?: string[] | undefined;
413
- }>;
414
- type VercelOutputConfig = z.infer<typeof vercelOutputConfigSchema>;
3
+ //#region src/index.d.ts
415
4
 
416
5
  /**
417
- * Schema definition for `.vercel/output/config.json`
418
- * @see {@link https://vercel.com/docs/build-output-api/v3#build-output-configuration}
6
+ * Scans the filesystem for entry points.
7
+ * @experimental
419
8
  */
420
-
421
- declare const vercelOutputPrerenderConfigSchema: z.ZodObject<{
422
- expiration: z.ZodUnion<[z.ZodNumber, z.ZodLiteral<false>]>;
423
- group: z.ZodOptional<z.ZodNumber>;
424
- bypassToken: z.ZodOptional<z.ZodString>;
425
- fallback: z.ZodOptional<z.ZodString>;
426
- allowQuery: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
427
- }, "strict", z.ZodTypeAny, {
9
+ declare function getVercelEntries(dir: string, {
10
+ destination,
11
+ tryParseExports
12
+ }: {
13
+ destination?: string | undefined;
14
+ tryParseExports?: boolean | undefined;
15
+ }): Promise<EntryMeta[]>;
16
+ declare function extractExports(filepath: string): Promise<{
17
+ edge?: boolean | undefined;
18
+ headers?: Record<string, string> | undefined;
19
+ streaming?: boolean | undefined;
20
+ isr?: {
428
21
  expiration: number | false;
429
- group?: number | undefined;
430
- bypassToken?: string | undefined;
431
- fallback?: string | undefined;
432
- allowQuery?: string[] | undefined;
433
- }, {
434
- expiration: number | false;
435
- group?: number | undefined;
436
- bypassToken?: string | undefined;
437
- fallback?: string | undefined;
438
- allowQuery?: string[] | undefined;
439
- }>;
440
- type VercelOutputPrerenderConfig = z.infer<typeof vercelOutputPrerenderConfigSchema>;
441
-
442
- /**
443
- * Schema definition for `.vercel/output/functions/<name>.func/.vc-config.json`
444
- * @see {@link https://vercel.com/docs/build-output-api/v3/primitives#serverless-function-configuration}
445
- */
446
-
447
- declare const vercelOutputVcConfigSchema: z.ZodUnion<[z.ZodObject<{
448
- runtime: z.ZodLiteral<"edge">;
449
- entrypoint: z.ZodString;
450
- envVarsInUse: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
451
- }, "strict", z.ZodTypeAny, {
452
- runtime: "edge";
453
- entrypoint: string;
454
- envVarsInUse?: string[] | undefined;
455
- }, {
456
- runtime: "edge";
457
- entrypoint: string;
458
- envVarsInUse?: string[] | undefined;
459
- }>, z.ZodObject<{
460
- runtime: z.ZodString;
461
- handler: z.ZodString;
462
- memory: z.ZodOptional<z.ZodNumber>;
463
- maxDuration: z.ZodOptional<z.ZodNumber>;
464
- environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
465
- regions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
466
- supportsWrapper: z.ZodOptional<z.ZodBoolean>;
467
- supportsResponseStreaming: z.ZodOptional<z.ZodBoolean>;
468
- }, "strict", z.ZodTypeAny, {
469
- handler: string;
470
- runtime: string;
471
- memory?: number | undefined;
472
- maxDuration?: number | undefined;
473
- environment?: Record<string, string> | undefined;
474
- regions?: string[] | undefined;
475
- supportsWrapper?: boolean | undefined;
476
- supportsResponseStreaming?: boolean | undefined;
477
- }, {
478
- handler: string;
479
- runtime: string;
480
- memory?: number | undefined;
481
- maxDuration?: number | undefined;
482
- environment?: Record<string, string> | undefined;
483
- regions?: string[] | undefined;
484
- supportsWrapper?: boolean | undefined;
485
- supportsResponseStreaming?: boolean | undefined;
486
- }>, z.ZodObject<{
487
- runtime: z.ZodString;
488
- handler: z.ZodString;
489
- memory: z.ZodOptional<z.ZodNumber>;
490
- maxDuration: z.ZodOptional<z.ZodNumber>;
491
- environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
492
- regions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
493
- supportsWrapper: z.ZodOptional<z.ZodBoolean>;
494
- supportsResponseStreaming: z.ZodOptional<z.ZodBoolean>;
495
- } & {
496
- launcherType: z.ZodLiteral<"Nodejs">;
497
- shouldAddHelpers: z.ZodOptional<z.ZodBoolean>;
498
- shouldAddSourcemapSupport: z.ZodOptional<z.ZodBoolean>;
499
- awsLambdaHandler: z.ZodOptional<z.ZodString>;
500
- }, "strict", z.ZodTypeAny, {
501
- handler: string;
502
- runtime: string;
503
- launcherType: "Nodejs";
504
- memory?: number | undefined;
505
- maxDuration?: number | undefined;
506
- environment?: Record<string, string> | undefined;
507
- regions?: string[] | undefined;
508
- supportsWrapper?: boolean | undefined;
509
- supportsResponseStreaming?: boolean | undefined;
510
- shouldAddHelpers?: boolean | undefined;
511
- shouldAddSourcemapSupport?: boolean | undefined;
512
- awsLambdaHandler?: string | undefined;
513
- }, {
514
- handler: string;
515
- runtime: string;
516
- launcherType: "Nodejs";
517
- memory?: number | undefined;
518
- maxDuration?: number | undefined;
519
- environment?: Record<string, string> | undefined;
520
- regions?: string[] | undefined;
521
- supportsWrapper?: boolean | undefined;
522
- supportsResponseStreaming?: boolean | undefined;
523
- shouldAddHelpers?: boolean | undefined;
524
- shouldAddSourcemapSupport?: boolean | undefined;
525
- awsLambdaHandler?: string | undefined;
526
- }>]>;
527
- type VercelOutputVcConfig = z.infer<typeof vercelOutputVcConfigSchema>;
528
-
529
- type ViteVercelRewrite = Rewrite & {
530
- enforce?: "pre" | "post";
531
- };
532
- type ViteVercelRedirect = Redirect & {
533
- enforce?: "pre" | "post";
534
- };
535
- type Awaitable<T> = T | Promise<T>;
536
- interface ViteVercelConfig {
537
- /**
538
- * How long Functions should be allowed to run for every request, in seconds.
539
- * If left empty, default value for your plan will be used.
540
- */
541
- defaultMaxDuration?: number;
542
- /**
543
- * Default expiration time (in seconds) for prerender functions.
544
- * Defaults to 86400 seconds (24h).
545
- * @see {@link https://vercel.com/docs/concepts/next.js/incremental-static-regeneration}
546
- * @see {@link https://vercel.com/docs/build-output-api/v3#vercel-primitives/prerender-functions/configuration}
547
- */
548
- expiration?: number;
549
- /**
550
- * Also known as Server Side Generation, or SSG.
551
- * If present, this function is responsible to create static files in `.vercel/output/static`.
552
- * Defaults to `false`, which disables prerendering.
553
- */
554
- prerender?: ViteVercelPrerenderFn | false;
555
- /**
556
- * @see {@link https://vercel.com/docs/projects/project-configuration#rewrites}
557
- */
558
- rewrites?: ViteVercelRewrite[];
559
- /**
560
- * @see {@link https://vercel.com/docs/projects/project-configuration#headers}
561
- * @beta
562
- */
563
- headers?: Header[] | (() => Awaitable<Header[]>);
564
- /**
565
- * @see {@link https://vercel.com/docs/projects/project-configuration#redirects}
566
- */
567
- redirects?: ViteVercelRedirect[];
568
- /**
569
- * @see {@link https://vercel.com/docs/projects/project-configuration#cleanurls}
570
- */
571
- cleanUrls?: boolean;
572
- /**
573
- * @see {@link https://vercel.com/docs/projects/project-configuration#trailingslash}
574
- */
575
- trailingSlash?: boolean;
576
- /**
577
- * When true, the Serverless Function will stream the response to the client.
578
- * @see {@link https://vercel.com/docs/build-output-api/v3/primitives#serverless-function-configuration}
579
- */
580
- defaultSupportsResponseStreaming?: boolean;
581
- /**
582
- * By default, all `api/*` endpoints are compiled under `.vercel/output/functions/api/*.func`.
583
- * If others serverless functions need to be compiled under `.vercel/output/functions`, they should be added here.
584
- * For instance, a framework can leverage this to have a generic ssr endpoint
585
- * without requiring the user to write any code.
586
- *
587
- * @example
588
- * ```
589
- * {
590
- * additionalEndpoints: [
591
- * {
592
- * // can also be an Object representing an esbuild StdinOptions
593
- * source: '/path/to/file.ts',
594
- * // URL path of the handler, will be generated to `.vercel/output/functions/api/file.func/index.js`
595
- * destination: '/api/file',
596
- * }
597
- * ]
598
- * }
599
- * ```
600
- */
601
- additionalEndpoints?: (ViteVercelApiEntry | (() => Awaitable<ViteVercelApiEntry>) | (() => Awaitable<ViteVercelApiEntry[]>))[];
602
- /**
603
- * Advanced configuration to override .vercel/output/config.json
604
- * @see {@link https://vercel.com/docs/build-output-api/v3/configuration#configuration}
605
- * @protected
606
- */
607
- config?: Partial<Omit<VercelOutputConfig, "version">>;
608
- /**
609
- * ISR and SSG pages are mutually exclusive. If a page is found in both, ISR prevails.
610
- * Keys are path relative to .vercel/output/functions directory, either without extension,
611
- * or with `.prerender-config.json` extension.
612
- * If you have multiple isr configurations pointing to the same underlying function, you can leverage the `symlink`
613
- * property. See example below.
614
- *
615
- * @example
616
- * ```
617
- * // Here `ssr_` means that a function is available under `.vercel/output/functions/ssr_.func`
618
- * isr: {
619
- * '/pages/a': { expiration: 15, symlink: 'ssr_', route: '^/a/.*$' },
620
- * '/pages/b/c': { expiration: 15, symlink: 'ssr_', route: '^/b/c/.*$' },
621
- * '/pages/d': { expiration: 15, symlink: 'ssr_', route: '^/d$' },
622
- * '/pages/e': { expiration: 25 }
623
- * }
624
- * ```
625
- *
626
- * @protected
627
- */
628
- isr?: Record<string, VercelOutputIsr> | (() => Awaitable<Record<string, VercelOutputIsr>>);
629
- /**
630
- * Defaults to `.vercel/output`. Mostly useful for testing purpose
631
- * @protected
632
- */
633
- outDir?: string;
634
- /**
635
- * By default, Vite generates static files under `dist` folder.
636
- * But usually, when used through a Framework, such as Vike,
637
- * this folder can contain anything, requiring custom integration.
638
- * Set this to false if you create a plugin for a Framework.
639
- */
640
- distContainsOnlyStatic?: boolean;
641
- }
642
- interface VercelOutputIsr extends VercelOutputPrerenderConfig {
643
- symlink?: string;
644
- route?: string;
645
- }
646
- /**
647
- * Keys are path relative to .vercel/output/static directory
648
- */
649
- type ViteVercelPrerenderRoute = VercelOutputConfig["overrides"];
650
- type ViteVercelPrerenderFn = (resolvedConfig: ResolvedConfig) => Awaitable<ViteVercelPrerenderRoute>;
651
- interface ViteVercelApiEntry {
652
- /**
653
- * Path to entry file, or stdin config
654
- */
655
- source: string | StdinOptions;
656
- /**
657
- * Relative to `.vercel/output/functions`, without extension
658
- */
659
- destination: string;
660
- /**
661
- * Override esbuild options
662
- */
663
- buildOptions?: BuildOptions;
664
- /**
665
- * @deprecated use `route` instead
666
- */
667
- addRoute?: boolean;
668
- /**
669
- * If `true`, guesses route for the function, and adds it to config.json (mimics defaults Vercel behavior).
670
- * If a string is provided, it will be equivalent to a `rewrites` rule.
671
- * Set to `false` to disable
672
- */
673
- route?: string | boolean;
674
- /**
675
- * Set to `true` to mark this function as an Edge Function
676
- */
677
- edge?: boolean;
678
- /**
679
- * Additional headers
680
- */
681
- headers?: Record<string, string> | null;
682
- /**
683
- * ISR config
684
- */
685
- isr?: VercelOutputIsr;
686
- /**
687
- * When true, the Serverless Function will stream the response to the client
688
- */
689
- streaming?: boolean;
690
- }
691
-
692
- declare function allPlugins(options?: any): PluginOption[];
693
-
694
- export { type Awaitable, type VercelOutputConfig, type VercelOutputIsr, type VercelOutputPrerenderConfig, type VercelOutputVcConfig, type ViteVercelApiEntry, type ViteVercelConfig, type ViteVercelPrerenderFn, type ViteVercelPrerenderRoute, type ViteVercelRedirect, type ViteVercelRewrite, allPlugins as default };
22
+ } | undefined;
23
+ } | null>;
24
+ //#endregion
25
+ export { extractExports, getVercelEntries };