@sveltejs/adapter-netlify 4.4.2 → 5.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.js +16 -4
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -55,6 +55,18 @@ export default function ({ split = false, edge = edge_set_in_env_var } = {}) {
|
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
if (existsSync(`${builder.config.kit.files.assets}/_headers`)) {
|
|
59
|
+
throw new Error(
|
|
60
|
+
`The _headers file should be placed in the project root rather than the ${builder.config.kit.files.assets} directory`
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (existsSync(`${builder.config.kit.files.assets}/_redirects`)) {
|
|
65
|
+
throw new Error(
|
|
66
|
+
`The _redirects file should be placed in the project root rather than the ${builder.config.kit.files.assets} directory`
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
58
70
|
const netlify_config = get_netlify_config();
|
|
59
71
|
|
|
60
72
|
// "build" is the default publish directory when Netlify detects SvelteKit
|
|
@@ -298,12 +310,12 @@ function generate_lambda_functions({ builder, publish, split }) {
|
|
|
298
310
|
// so that generated redirects are appended to custom redirects
|
|
299
311
|
// rather than replaced by them
|
|
300
312
|
builder.log.minor('Writing redirects...');
|
|
301
|
-
const
|
|
313
|
+
const redirects_file = join(publish, '_redirects');
|
|
302
314
|
if (existsSync('_redirects')) {
|
|
303
|
-
builder.copy('_redirects',
|
|
315
|
+
builder.copy('_redirects', redirects_file);
|
|
304
316
|
}
|
|
305
|
-
builder.mkdirp(dirname(
|
|
306
|
-
appendFileSync(
|
|
317
|
+
builder.mkdirp(dirname(redirects_file));
|
|
318
|
+
appendFileSync(redirects_file, `\n\n${redirects.join('\n')}`);
|
|
307
319
|
}
|
|
308
320
|
|
|
309
321
|
function get_netlify_config() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/adapter-netlify",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "A SvelteKit adapter that creates a Netlify app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adapter",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@iarna/toml": "^2.2.5",
|
|
36
|
-
"esbuild": "^0.
|
|
36
|
+
"esbuild": "^0.25.2",
|
|
37
37
|
"set-cookie-parser": "^2.6.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"@types/set-cookie-parser": "^2.4.7",
|
|
47
47
|
"rollup": "^4.14.2",
|
|
48
48
|
"typescript": "^5.3.3",
|
|
49
|
-
"vitest": "^3.
|
|
50
|
-
"@sveltejs/kit": "^2.
|
|
49
|
+
"vitest": "^3.1.1",
|
|
50
|
+
"@sveltejs/kit": "^2.20.8"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@sveltejs/kit": "^2.4.0"
|