-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathvite.config.mts
62 lines (60 loc) · 1.53 KB
/
vite.config.mts
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
53
54
55
56
57
58
59
60
61
62
import react from '@vitejs/plugin-react-swc';
import type { UserConfig } from 'vite';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import { configDefaults } from 'vitest/config';
import type { InlineConfig } from 'vitest/node';
interface VitestConfigExport extends UserConfig {
test: InlineConfig;
}
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), tsconfigPaths()],
build: {
outDir: 'dist',
},
resolve: {
alias: {
// @ts-ignore
'@/': new URL('src/', import.meta.url).pathname,
},
},
test: {
// Setting pool='forks' is preventing this issue https://github.com/vitest-dev/vitest/issues/3077
pool: 'forks',
globals: true,
root: __dirname,
environment: 'jsdom',
setupFiles: ['./scripts/vitest.setup.ts'],
exclude: [
...configDefaults.exclude,
'**/node_modules/**',
'**/dist/**',
'**/**.mocks.spec.ts',
],
coverage: {
reporter: ['text', 'html'],
exclude: [
'_snapshots_',
'.eslint*',
'.prettier*',
'coverage',
'dist/**',
'**/test/**',
'e2e/**',
'public/**',
'*.mjs',
'*.cjs',
'*/reportWebVitals.ts',
'*/main.tsx',
'*/AppProvider.tsx',
'*/vite-env.d.ts',
'**/test.tsx',
'**/routes/index.tsx',
'**/**.effect.ts', // we don't want to unit test side effects
'**/**.type.ts',
'**/helpers/**',
],
},
},
} as VitestConfigExport);