@sveltejs/adapter-vercel 2.4.3 → 3.0.1
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/index.d.ts +0 -5
- package/index.js +8 -17
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -63,11 +63,6 @@ export interface EdgeConfig {
|
|
|
63
63
|
* More info: https://vercel.com/docs/concepts/edge-network/regions
|
|
64
64
|
*/
|
|
65
65
|
regions?: string[] | 'all';
|
|
66
|
-
/**
|
|
67
|
-
* List of environment variable names that will be available for the Edge Function to utilize.
|
|
68
|
-
* Edge only.
|
|
69
|
-
*/
|
|
70
|
-
envVarsInUse?: string[];
|
|
71
66
|
/**
|
|
72
67
|
* List of packages that should not be bundled into the Edge Function.
|
|
73
68
|
* Edge only.
|
package/index.js
CHANGED
|
@@ -96,13 +96,6 @@ const plugin = function (defaults = {}) {
|
|
|
96
96
|
const tmp = builder.getBuildDirectory(`vercel-tmp/${name}`);
|
|
97
97
|
const relativePath = path.posix.relative(tmp, builder.getServerDirectory());
|
|
98
98
|
|
|
99
|
-
const envVarsInUse = new Set();
|
|
100
|
-
routes.forEach((route) => {
|
|
101
|
-
route.config?.envVarsInUse?.forEach((x) => {
|
|
102
|
-
envVarsInUse.add(x);
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
|
|
106
99
|
builder.copy(`${files}/edge.js`, `${tmp}/edge.js`, {
|
|
107
100
|
replace: {
|
|
108
101
|
SERVER: `${relativePath}/index.js`,
|
|
@@ -124,7 +117,10 @@ const plugin = function (defaults = {}) {
|
|
|
124
117
|
format: 'esm',
|
|
125
118
|
external: config.external,
|
|
126
119
|
sourcemap: 'linked',
|
|
127
|
-
banner: { js: 'globalThis.global = globalThis;' }
|
|
120
|
+
banner: { js: 'globalThis.global = globalThis;' },
|
|
121
|
+
loader: {
|
|
122
|
+
'.wasm': 'copy'
|
|
123
|
+
}
|
|
128
124
|
});
|
|
129
125
|
|
|
130
126
|
write(
|
|
@@ -133,7 +129,6 @@ const plugin = function (defaults = {}) {
|
|
|
133
129
|
{
|
|
134
130
|
runtime: config.runtime,
|
|
135
131
|
regions: config.regions,
|
|
136
|
-
envVarsInUse: [...envVarsInUse],
|
|
137
132
|
entrypoint: 'index.js'
|
|
138
133
|
},
|
|
139
134
|
null,
|
|
@@ -229,7 +224,7 @@ const plugin = function (defaults = {}) {
|
|
|
229
224
|
|
|
230
225
|
if (ignored_isr.size) {
|
|
231
226
|
builder.log.warn(
|
|
232
|
-
|
|
227
|
+
'\nWarning: The following routes have an ISR config which is ignored because the route is prerendered:'
|
|
233
228
|
);
|
|
234
229
|
|
|
235
230
|
for (const ignored of ignored_isr) {
|
|
@@ -580,18 +575,14 @@ function validate_vercel_json(builder, vercel_config) {
|
|
|
580
575
|
continue;
|
|
581
576
|
}
|
|
582
577
|
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
continue;
|
|
586
|
-
}
|
|
578
|
+
if (!valid_routes.some((route) => route.pattern.test(path))) {
|
|
579
|
+
unmatched_paths.push(path);
|
|
587
580
|
}
|
|
588
|
-
|
|
589
|
-
unmatched_paths.push(path);
|
|
590
581
|
}
|
|
591
582
|
|
|
592
583
|
if (unmatched_paths.length) {
|
|
593
584
|
builder.log.warn(
|
|
594
|
-
|
|
585
|
+
'\nWarning: vercel.json defines cron tasks that use paths that do not correspond to an API route with a GET handler (ignore this if the request is handled in your `handle` hook):'
|
|
595
586
|
);
|
|
596
587
|
|
|
597
588
|
for (const path of unmatched_paths) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/adapter-vercel",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "A SvelteKit adapter that creates a Vercel app",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^16.18.6",
|
|
33
33
|
"typescript": "^4.9.4",
|
|
34
|
-
"
|
|
35
|
-
"@sveltejs/kit": "^1.
|
|
34
|
+
"vitest": "^0.31.0",
|
|
35
|
+
"@sveltejs/kit": "^1.20.1"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@sveltejs/kit": "^1.5.0"
|
|
@@ -41,6 +41,6 @@
|
|
|
41
41
|
"lint": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore",
|
|
42
42
|
"format": "pnpm lint --write",
|
|
43
43
|
"check": "tsc",
|
|
44
|
-
"test": "
|
|
44
|
+
"test": "vitest run"
|
|
45
45
|
}
|
|
46
46
|
}
|