-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
51 lines (48 loc) · 1.33 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
/// <reference types="vitest" />
/// <reference types="vite/client" />
import path from 'path'
import { fileURLToPath } from 'url'
import react from '@vitejs/plugin-react-swc'
import { defineConfig } from 'vite'
import { configDefaults } from 'vitest/config'
import { lingui } from '@lingui/vite-plugin'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
export default defineConfig({
plugins: [
react({
plugins: [['@lingui/swc-plugin', {}]],
}),
lingui(),
],
resolve: {
alias: {
"@": path.resolve(__dirname, './src'),
},
},
test: {
globals: true,
environment: 'jsdom',
environmentOptions: {
jsdom: {
url: 'http://localhost:5173'
}
},
setupFiles: './src/test/setup.ts',
coverage: {
provider: 'v8',
reporter: ['text', 'html'],
exclude: [...configDefaults.coverage.exclude, '**/test/**', '**/components/ui/**'],
},
include: ['./src/**/*.test.(tsx|ts)'],
exclude: [...configDefaults.exclude, '**/test/**', '**/components/ui/**'],
// Cool feature but experimental, slow and does not seem to work currently in this project
// https://vitest.dev/guide/browser.html
// browser: {
// enabled: true,
// name: 'firefox'
// },
// since parsing CSS is slow
// css: true,
},
})