vite-plugin-vercel 0.3.6 → 0.3.7
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 +9 -5
- package/dist/index.js +13 -6
- package/package.json +12 -12
package/dist/index.cjs
CHANGED
|
@@ -179,13 +179,17 @@ function getConfig(resolvedConfig, rewrites, overrides) {
|
|
|
179
179
|
"It is discouraged to use `vercel.config.routes` to override routes. Prefer using `vercel.rewrites` and `vercel.redirects`."
|
|
180
180
|
);
|
|
181
181
|
}
|
|
182
|
+
const cleanRoutes = (0, import_routing_utils.normalizeRoutes)([
|
|
183
|
+
...routes ?? [],
|
|
184
|
+
...((_i = (_h = resolvedConfig.vercel) == null ? void 0 : _h.config) == null ? void 0 : _i.routes) ?? []
|
|
185
|
+
]);
|
|
186
|
+
if (cleanRoutes.error) {
|
|
187
|
+
throw cleanRoutes.error;
|
|
188
|
+
}
|
|
182
189
|
return vercelOutputConfigSchema.parse({
|
|
183
190
|
version: 3,
|
|
184
|
-
...(
|
|
185
|
-
routes:
|
|
186
|
-
...routes ?? [],
|
|
187
|
-
...((_j = (_i = resolvedConfig.vercel) == null ? void 0 : _i.config) == null ? void 0 : _j.routes) ?? []
|
|
188
|
-
],
|
|
191
|
+
...(_j = resolvedConfig.vercel) == null ? void 0 : _j.config,
|
|
192
|
+
routes: cleanRoutes.routes,
|
|
189
193
|
overrides: {
|
|
190
194
|
...(_l = (_k = resolvedConfig.vercel) == null ? void 0 : _k.config) == null ? void 0 : _l.overrides,
|
|
191
195
|
...overrides
|
package/dist/index.js
CHANGED
|
@@ -116,7 +116,10 @@ var vercelOutputConfigSchema = z.object({
|
|
|
116
116
|
|
|
117
117
|
// src/config.ts
|
|
118
118
|
import fs from "fs/promises";
|
|
119
|
-
import {
|
|
119
|
+
import {
|
|
120
|
+
getTransformedRoutes,
|
|
121
|
+
normalizeRoutes
|
|
122
|
+
} from "@vercel/routing-utils";
|
|
120
123
|
function reorderEnforce(arr) {
|
|
121
124
|
return [
|
|
122
125
|
...arr.filter((r) => r.enforce === "pre"),
|
|
@@ -145,13 +148,17 @@ function getConfig(resolvedConfig, rewrites, overrides) {
|
|
|
145
148
|
"It is discouraged to use `vercel.config.routes` to override routes. Prefer using `vercel.rewrites` and `vercel.redirects`."
|
|
146
149
|
);
|
|
147
150
|
}
|
|
151
|
+
const cleanRoutes = normalizeRoutes([
|
|
152
|
+
...routes ?? [],
|
|
153
|
+
...((_i = (_h = resolvedConfig.vercel) == null ? void 0 : _h.config) == null ? void 0 : _i.routes) ?? []
|
|
154
|
+
]);
|
|
155
|
+
if (cleanRoutes.error) {
|
|
156
|
+
throw cleanRoutes.error;
|
|
157
|
+
}
|
|
148
158
|
return vercelOutputConfigSchema.parse({
|
|
149
159
|
version: 3,
|
|
150
|
-
...(
|
|
151
|
-
routes:
|
|
152
|
-
...routes ?? [],
|
|
153
|
-
...((_j = (_i = resolvedConfig.vercel) == null ? void 0 : _i.config) == null ? void 0 : _j.routes) ?? []
|
|
154
|
-
],
|
|
160
|
+
...(_j = resolvedConfig.vercel) == null ? void 0 : _j.config,
|
|
161
|
+
routes: cleanRoutes.routes,
|
|
155
162
|
overrides: {
|
|
156
163
|
...(_l = (_k = resolvedConfig.vercel) == null ? void 0 : _k.config) == null ? void 0 : _l.overrides,
|
|
157
164
|
...overrides
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-vercel",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"repository": "https://github.com/magne4000/vite-plugin-vercel",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"vite": "^4.2.0",
|
|
24
23
|
"vike": "*",
|
|
25
|
-
"
|
|
24
|
+
"vite": "^4.2.0",
|
|
25
|
+
"@vite-plugin-vercel/vike": "0.4.2"
|
|
26
26
|
},
|
|
27
27
|
"peerDependenciesMeta": {
|
|
28
28
|
"@vite-plugin-vercel/vike": {
|
|
@@ -33,22 +33,22 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@types/node": "^16.18.
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
38
|
-
"@typescript-eslint/parser": "^6.
|
|
39
|
-
"eslint": "^8.
|
|
36
|
+
"@types/node": "^16.18.58",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^6.7.5",
|
|
38
|
+
"@typescript-eslint/parser": "^6.7.5",
|
|
39
|
+
"eslint": "^8.51.0",
|
|
40
40
|
"tsup": "^7.2.0",
|
|
41
41
|
"typescript": "^5.2.2",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"@vite-plugin-vercel/vike": "0.4.
|
|
42
|
+
"vike": "^0.4.143",
|
|
43
|
+
"vite": "^4.4.11",
|
|
44
|
+
"@vite-plugin-vercel/vike": "0.4.2"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@brillout/libassert": "^0.5.8",
|
|
48
48
|
"@vercel/routing-utils": "^3.0.0",
|
|
49
|
-
"esbuild": "^0.19.
|
|
49
|
+
"esbuild": "^0.19.4",
|
|
50
50
|
"fast-glob": "^3.3.1",
|
|
51
|
-
"zod": "^3.22.
|
|
51
|
+
"zod": "^3.22.4"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "tsup",
|