-
Notifications
You must be signed in to change notification settings - Fork 21
/
vite.config.ts
36 lines (34 loc) · 1.1 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
/// <reference types="vitest" />
import { defineConfig } from 'vite'
import { configDefaults } from 'vitest/config'
import react from '@vitejs/plugin-react'
import tsconfigPaths from 'vite-tsconfig-paths'
import browserslistToEsbuild from 'browserslist-to-esbuild'
const NOT_VALID_COMPONENTS_PATTERN = 'bar'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [tsconfigPaths(), react()],
assetsInclude: ['**/*.md'],
build: {
target: browserslistToEsbuild(),
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: 'vitest.setup.ts',
exclude: [
...configDefaults.exclude,
`**/components/${NOT_VALID_COMPONENTS_PATTERN}/**`,
'e2e/**',
],
// you might want to disable it, if you don't have tests that rely on CSS
// since parsing CSS is slow
css: true,
coverage: {
provider: 'istanbul',
exclude: ['**/packages/**/*.doc.mdx', '**/packages/**/*.stories.tsx', '**/documentation/*'],
reportsDirectory: 'dist/coverage',
reporter: [['lcovonly', {}], ['json', { file: 'coverage.json' }], ['html'], ['text']],
},
},
})