vite-plugin-vercel 0.1.5 → 0.1.6
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 +4 -6
- package/dist/index.d.ts +10 -10
- package/dist/index.js +4 -6
- package/package.json +12 -12
package/dist/index.cjs
CHANGED
|
@@ -159,12 +159,10 @@ function getConfig(resolvedConfig, rewrites, overrides) {
|
|
|
159
159
|
...rewrites ?? []
|
|
160
160
|
];
|
|
161
161
|
const { routes, error } = (0, import_routing_utils.getTransformedRoutes)({
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
redirects: ((_d = resolvedConfig.vercel) == null ? void 0 : _d.redirects) ? reorderEnforce((_e = resolvedConfig.vercel) == null ? void 0 : _e.redirects) : void 0
|
|
167
|
-
}
|
|
162
|
+
cleanUrls: ((_b = resolvedConfig.vercel) == null ? void 0 : _b.cleanUrls) ?? true,
|
|
163
|
+
trailingSlash: (_c = resolvedConfig.vercel) == null ? void 0 : _c.trailingSlash,
|
|
164
|
+
rewrites: reorderEnforce(_rewrites),
|
|
165
|
+
redirects: ((_d = resolvedConfig.vercel) == null ? void 0 : _d.redirects) ? reorderEnforce((_e = resolvedConfig.vercel) == null ? void 0 : _e.redirects) : void 0
|
|
168
166
|
});
|
|
169
167
|
if (error) {
|
|
170
168
|
throw error;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResolvedConfig, Plugin } from 'vite';
|
|
2
2
|
import { StdinOptions, BuildOptions } from 'esbuild';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import {
|
|
4
|
+
import { Rewrite, Redirect } from '@vercel/routing-utils';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Schema definition for `.vercel/output/config.json`
|
|
@@ -411,7 +411,7 @@ declare const vercelOutputConfigSchema: z.ZodObject<{
|
|
|
411
411
|
cache?: string[] | undefined;
|
|
412
412
|
version: 3;
|
|
413
413
|
}>;
|
|
414
|
-
|
|
414
|
+
type VercelOutputConfig = z.infer<typeof vercelOutputConfigSchema>;
|
|
415
415
|
|
|
416
416
|
/**
|
|
417
417
|
* Schema definition for `.vercel/output/config.json`
|
|
@@ -486,7 +486,7 @@ declare const vercelOutputVcConfigSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
486
486
|
handler: string;
|
|
487
487
|
launcherType: "Nodejs";
|
|
488
488
|
}>]>;
|
|
489
|
-
|
|
489
|
+
type VercelOutputVcConfig = z.infer<typeof vercelOutputVcConfigSchema>;
|
|
490
490
|
|
|
491
491
|
/**
|
|
492
492
|
* Schema definition for `.vercel/output/config.json`
|
|
@@ -512,12 +512,12 @@ declare const vercelOutputPrerenderConfigSchema: z.ZodObject<{
|
|
|
512
512
|
allowQuery?: string[] | undefined;
|
|
513
513
|
expiration: number | false;
|
|
514
514
|
}>;
|
|
515
|
-
|
|
515
|
+
type VercelOutputPrerenderConfig = z.infer<typeof vercelOutputPrerenderConfigSchema>;
|
|
516
516
|
|
|
517
|
-
|
|
517
|
+
type ViteVercelRewrite = Rewrite & {
|
|
518
518
|
enforce?: 'pre' | 'post';
|
|
519
519
|
};
|
|
520
|
-
|
|
520
|
+
type ViteVercelRedirect = Redirect & {
|
|
521
521
|
enforce?: 'pre' | 'post';
|
|
522
522
|
};
|
|
523
523
|
interface ViteVercelConfig {
|
|
@@ -561,8 +561,8 @@ interface ViteVercelConfig {
|
|
|
561
561
|
*/
|
|
562
562
|
rewrites?: ViteVercelRewrite[];
|
|
563
563
|
redirects?: ViteVercelRedirect[];
|
|
564
|
-
cleanUrls?:
|
|
565
|
-
trailingSlash?:
|
|
564
|
+
cleanUrls?: boolean;
|
|
565
|
+
trailingSlash?: boolean;
|
|
566
566
|
additionalEndpoints?: ViteVercelApiEntry[];
|
|
567
567
|
/**
|
|
568
568
|
* Advanced configuration to override .vercel/output/config.json
|
|
@@ -604,8 +604,8 @@ interface VercelOutputIsr extends VercelOutputPrerenderConfig {
|
|
|
604
604
|
/**
|
|
605
605
|
* Keys are path relative to .vercel/output/static directory
|
|
606
606
|
*/
|
|
607
|
-
|
|
608
|
-
|
|
607
|
+
type ViteVercelPrerenderRoute = VercelOutputConfig['overrides'];
|
|
608
|
+
type ViteVercelPrerenderFn = (resolvedConfig: ResolvedConfig) => ViteVercelPrerenderRoute | Promise<ViteVercelPrerenderRoute>;
|
|
609
609
|
interface ViteVercelApiEntry {
|
|
610
610
|
/**
|
|
611
611
|
* Path to entry file, or stdin config
|
package/dist/index.js
CHANGED
|
@@ -129,12 +129,10 @@ function getConfig(resolvedConfig, rewrites, overrides) {
|
|
|
129
129
|
...rewrites ?? []
|
|
130
130
|
];
|
|
131
131
|
const { routes, error } = getTransformedRoutes({
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
redirects: ((_d = resolvedConfig.vercel) == null ? void 0 : _d.redirects) ? reorderEnforce((_e = resolvedConfig.vercel) == null ? void 0 : _e.redirects) : void 0
|
|
137
|
-
}
|
|
132
|
+
cleanUrls: ((_b = resolvedConfig.vercel) == null ? void 0 : _b.cleanUrls) ?? true,
|
|
133
|
+
trailingSlash: (_c = resolvedConfig.vercel) == null ? void 0 : _c.trailingSlash,
|
|
134
|
+
rewrites: reorderEnforce(_rewrites),
|
|
135
|
+
redirects: ((_d = resolvedConfig.vercel) == null ? void 0 : _d.redirects) ? reorderEnforce((_e = resolvedConfig.vercel) == null ? void 0 : _e.redirects) : void 0
|
|
138
136
|
});
|
|
139
137
|
if (error) {
|
|
140
138
|
throw error;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-vercel",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -23,20 +23,20 @@
|
|
|
23
23
|
"vite": "^3.0.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@types/node": "^16.11
|
|
27
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
28
|
-
"@typescript-eslint/parser": "^5.
|
|
29
|
-
"eslint": "^8.
|
|
30
|
-
"tsup": "^6.
|
|
31
|
-
"typescript": "^4.
|
|
32
|
-
"vite": "^3.
|
|
26
|
+
"@types/node": "^16.18.11",
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "^5.48.1",
|
|
28
|
+
"@typescript-eslint/parser": "^5.48.1",
|
|
29
|
+
"eslint": "^8.31.0",
|
|
30
|
+
"tsup": "^6.5.0",
|
|
31
|
+
"typescript": "^4.9.4",
|
|
32
|
+
"vite": "^3.2.5"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@brillout/libassert": "^0.5.8",
|
|
36
|
-
"@vercel/routing-utils": "^1.
|
|
37
|
-
"esbuild": "^0.
|
|
38
|
-
"fast-glob": "^3.2.
|
|
39
|
-
"zod": "^3.
|
|
36
|
+
"@vercel/routing-utils": "^2.1.3",
|
|
37
|
+
"esbuild": "^0.16.16",
|
|
38
|
+
"fast-glob": "^3.2.12",
|
|
39
|
+
"zod": "^3.20.2"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "tsup",
|