-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
52 lines (49 loc) · 1.16 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { sveltekit } from '@sveltejs/kit/vite';
import { configDefaults, defineConfig } from 'vitest/config';
const VITEST_IGNORE_PATTERNS = [
...configDefaults.exclude,
'.github/**',
'.svelte-kit/**',
'.vercel_build_output/**',
'.vercel/**',
'.vscode/**'
] satisfies typeof configDefaults.exclude;
const VITEST_COVERAGE_IGNORE_PATTERNS = [
...VITEST_IGNORE_PATTERNS,
'**/*.svelte', // E2E test is needed
'src/routes/**/+*.ts',
'**/*{.,-}{test,spec}{,-d}.{ts,svelte}',
'svelte.config.js'
] satisfies typeof configDefaults.coverage.exclude;
export default defineConfig({
plugins: [sveltekit()],
preview: {
port: 3000,
strictPort: true
},
server: {
port: 3000,
strictPort: true
},
test: {
includeSource: ['src/lib/**/*.ts'],
exclude: VITEST_IGNORE_PATTERNS,
watch: false,
coverage: {
enabled: true,
all: true,
reportsDirectory: './coverage',
reportOnFailure: true,
exclude: VITEST_COVERAGE_IGNORE_PATTERNS
},
typecheck: {
ignoreSourceErrors: true,
checker: 'tsc',
include: ['**/*{.,-}{test-d,spec-d}.{ts,svelte}'],
tsconfig: './tsconfig.vitest-typecheck.json'
}
},
define: {
'import.meta.vitest': 'undefined'
}
});