@sveltejs/adapter-vercel 6.3.2 → 6.3.4
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.js +7 -2
- package/package.json +7 -8
- package/utils.js +4 -6
package/index.js
CHANGED
|
@@ -231,7 +231,8 @@ const plugin = function (defaults = {}) {
|
|
|
231
231
|
throw new Error(
|
|
232
232
|
`Bundling with esbuild failed with ${error.errors.length} ${
|
|
233
233
|
error.errors.length === 1 ? 'error' : 'errors'
|
|
234
|
-
}
|
|
234
|
+
}`,
|
|
235
|
+
{ cause: err }
|
|
235
236
|
);
|
|
236
237
|
}
|
|
237
238
|
|
|
@@ -682,10 +683,14 @@ function static_vercel_config(builder, config, dir) {
|
|
|
682
683
|
// Prevent incorrect caching: if a request to /_app/immutable/* doesn't match
|
|
683
684
|
// a static file, return 404 instead of falling through to dynamic routes.
|
|
684
685
|
// Otherwise, we could accidentally immutably cache dynamic content served
|
|
685
|
-
// by the fallback function.
|
|
686
|
+
// by the fallback function. `no-store` stops the earlier immutable header
|
|
687
|
+
// from sticking to this 404, so a missing asset isn't cached for a year.
|
|
686
688
|
routes.push({
|
|
687
689
|
src: `/${builder.getAppPath()}/immutable/.+`,
|
|
688
690
|
status: 404,
|
|
691
|
+
headers: {
|
|
692
|
+
'cache-control': 'no-store'
|
|
693
|
+
},
|
|
689
694
|
continue: false
|
|
690
695
|
});
|
|
691
696
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/adapter-vercel",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.4",
|
|
4
4
|
"description": "A SvelteKit adapter that creates a Vercel app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adapter",
|
|
@@ -34,15 +34,14 @@
|
|
|
34
34
|
"ambient.d.ts"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@vercel/nft": "^1.
|
|
38
|
-
"esbuild": "^0.
|
|
37
|
+
"@vercel/nft": "^1.3.2",
|
|
38
|
+
"esbuild": "^0.28.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"@sveltejs/kit": "^2.52.2"
|
|
41
|
+
"@types/node": "^18.19.130",
|
|
42
|
+
"typescript": "^6.0.2",
|
|
43
|
+
"vitest": "^4.1.7",
|
|
44
|
+
"@sveltejs/kit": "^2.66.0"
|
|
46
45
|
},
|
|
47
46
|
"peerDependencies": {
|
|
48
47
|
"@sveltejs/kit": "^2.4.0"
|
package/utils.js
CHANGED
|
@@ -11,7 +11,6 @@ export function get_pathname(route) {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
const parts = segment.content.split(/\[(.+?)\](?!\])/);
|
|
14
|
-
let result = '';
|
|
15
14
|
|
|
16
15
|
if (
|
|
17
16
|
parts.length === 3 &&
|
|
@@ -21,9 +20,9 @@ export function get_pathname(route) {
|
|
|
21
20
|
) {
|
|
22
21
|
// Special case: segment is a single optional or rest parameter.
|
|
23
22
|
// In that case we don't prepend a slash (also see comment in pattern_to_src).
|
|
24
|
-
|
|
23
|
+
return `$${i++}`;
|
|
25
24
|
} else {
|
|
26
|
-
|
|
25
|
+
return (
|
|
27
26
|
'/' +
|
|
28
27
|
parts
|
|
29
28
|
.map((content, j) => {
|
|
@@ -33,10 +32,9 @@ export function get_pathname(route) {
|
|
|
33
32
|
return content;
|
|
34
33
|
}
|
|
35
34
|
})
|
|
36
|
-
.join('')
|
|
35
|
+
.join('')
|
|
36
|
+
);
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
return result;
|
|
40
38
|
})
|
|
41
39
|
.join('');
|
|
42
40
|
|