Skip to content

Commit 48bccdc

Browse files
authored
[fix] add methodOverride to default configs (#3411)
* [fix] add methodOverride to default configs * Changeset
1 parent d00642f commit 48bccdc

File tree

7 files changed

+50
-0
lines changed

7 files changed

+50
-0
lines changed

Diff for: .changeset/tame-radios-build.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'create-svelte': patch
3+
---
4+
5+
Add methodOverrides to default configs
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import adapter from '@sveltejs/adapter-auto';
2+
import preprocess from 'svelte-preprocess';
3+
4+
/** @type {import('@sveltejs/kit').Config} */
5+
const config = {
6+
// Consult https://github.com/sveltejs/svelte-preprocess
7+
// for more information about preprocessors
8+
preprocess: preprocess(),
9+
10+
kit: {
11+
adapter: adapter(),
12+
13+
// hydrate the <div id="svelte"> element in src/app.html
14+
target: '#svelte',
15+
16+
// Override http methods in the Todo forms
17+
methodOverride: {
18+
allowed: ['PATCH', 'DELETE']
19+
}
20+
}
21+
};
22+
23+
export default config;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import adapter from '@sveltejs/adapter-auto';
2+
3+
/** @type {import('@sveltejs/kit').Config} */
4+
const config = {
5+
kit: {
6+
adapter: adapter(),
7+
8+
// hydrate the <div id="svelte"> element in src/app.html
9+
target: '#svelte',
10+
11+
// Override http methods in the Todo forms
12+
methodOverride: {
13+
allowed: ['PATCH', 'DELETE']
14+
}
15+
}
16+
};
17+
18+
export default config;

Diff for: packages/create-svelte/templates/default/svelte.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import adapter from '@sveltejs/adapter-auto';
22
import preprocess from 'svelte-preprocess';
33

4+
// This config is ignored and replaced with one of the configs in the shared folder when a project is created.
5+
46
/** @type {import('@sveltejs/kit').Config} */
57
const config = {
68
// Consult https://github.com/sveltejs/svelte-preprocess

Diff for: packages/create-svelte/templates/skeleton/svelte.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import adapter from '@sveltejs/adapter-auto';
22

3+
// This config is ignored and replaced with one of the configs in the shared folder when a project is created.
4+
35
/** @type {import('@sveltejs/kit').Config} */
46
const config = {
57
kit: {

0 commit comments

Comments
 (0)