Skip to content

Commit

Permalink
[fix] add methodOverride to default configs (#3411)
Browse files Browse the repository at this point in the history
* [fix] add methodOverride to default configs

* Changeset
  • Loading branch information
geoffrich authored Jan 19, 2022
1 parent d00642f commit 48bccdc
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/tame-radios-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-svelte': patch
---

Add methodOverrides to default configs
23 changes: 23 additions & 0 deletions packages/create-svelte/shared/+default+typescript/svelte.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import adapter from '@sveltejs/adapter-auto';
import preprocess from 'svelte-preprocess';

/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: preprocess(),

kit: {
adapter: adapter(),

// hydrate the <div id="svelte"> element in src/app.html
target: '#svelte',

// Override http methods in the Todo forms
methodOverride: {
allowed: ['PATCH', 'DELETE']
}
}
};

export default config;
18 changes: 18 additions & 0 deletions packages/create-svelte/shared/+default-typescript/svelte.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import adapter from '@sveltejs/adapter-auto';

/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
adapter: adapter(),

// hydrate the <div id="svelte"> element in src/app.html
target: '#svelte',

// Override http methods in the Todo forms
methodOverride: {
allowed: ['PATCH', 'DELETE']
}
}
};

export default config;
2 changes: 2 additions & 0 deletions packages/create-svelte/templates/default/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import adapter from '@sveltejs/adapter-auto';
import preprocess from 'svelte-preprocess';

// This config is ignored and replaced with one of the configs in the shared folder when a project is created.

/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
Expand Down
2 changes: 2 additions & 0 deletions packages/create-svelte/templates/skeleton/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import adapter from '@sveltejs/adapter-auto';

// This config is ignored and replaced with one of the configs in the shared folder when a project is created.

/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
Expand Down

0 comments on commit 48bccdc

Please sign in to comment.