-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.config.ts
48 lines (47 loc) · 1.09 KB
/
vitest.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
import react from '@vitejs/plugin-react'
import path from 'path'
import { defineConfig } from 'vite'
import svgr from 'vite-plugin-svgr'
export default defineConfig(({ mode }) => {
return {
test: {
globals: true,
setupFiles: ['./src/test/vitest.setup.ts'],
environment: 'jsdom',
threads: false,
trace: true,
restoreMocks: true,
environmentOptions: {
jsdom: {
resources: 'usable',
},
},
coverage: {
provider: 'istanbul',
reportsDirectory: 'coverage',
reporters: ['text-summary', 'html'],
},
},
plugins: [react(), svgr()],
clearScreen: false,
build: {
minify: 'esbuild',
sourcemap: true,
rollupOptions: {
manualChunks: {
mui: ['@mui/material'],
muicons: ['@mui/icons-material'],
},
} as import('rollup').RollupOptions,
},
resolve: {
alias: {
'~': path.join(__dirname, 'src'),
},
},
esbuild: {
pure: mode === 'production' ? ['console.log'] : [],
keepNames: true,
},
}
})