Skip to content

Commit

Permalink
change config type annotations to use defineConfig instead (#8871)
Browse files Browse the repository at this point in the history
  • Loading branch information
eltigerchino authored Feb 6, 2023
1 parent 25c3497 commit b02d795
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 27 deletions.
5 changes: 5 additions & 0 deletions .changeset/rotten-windows-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-svelte': patch
---

fix: adjust vite config type to work with vitest options
9 changes: 3 additions & 6 deletions packages/create-svelte/shared/+vitest/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { sveltekit } from '@sveltejs/kit/vite';
import type { UserConfig } from 'vite';
import { defineConfig } from 'vitest/config';

/** @type {import('vite').UserConfig} */
const config: UserConfig = {
export default defineConfig({
plugins: [sveltekit()],
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
}
};

export default config;
});
9 changes: 3 additions & 6 deletions packages/create-svelte/shared/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { sveltekit } from '@sveltejs/kit/vite';
import type { UserConfig } from 'vite';
import { defineConfig } from 'vite';

/** @type {import('vite').UserConfig} */
const config: UserConfig = {
export default defineConfig({
plugins: [sveltekit()]
};

export default config;
});
8 changes: 3 additions & 5 deletions packages/create-svelte/templates/default/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import path from 'path';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';

/** @type {import('vite').UserConfig} */
const config = {
export default defineConfig({
plugins: [sveltekit()],

server: {
fs: {
allow: [path.resolve('../../../kit')]
}
}
};

export default config;
});
8 changes: 3 additions & 5 deletions packages/create-svelte/templates/skeleton/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';

/** @type {import('vite').UserConfig} */
const config = {
export default defineConfig({
plugins: [sveltekit()]
};

export default config;
});
8 changes: 3 additions & 5 deletions packages/create-svelte/templates/skeletonlib/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';

/** @type {import('vite').UserConfig} */
const config = {
export default defineConfig({
plugins: [sveltekit()]
};

export default config;
});

0 comments on commit b02d795

Please sign in to comment.