-
Notifications
You must be signed in to change notification settings - Fork 26
/
vite.config.ts
67 lines (64 loc) · 1.51 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/// <reference types="vitest" />
import react from '@vitejs/plugin-react'
import path from 'path'
import { defineConfig } from 'vite'
import svgr from 'vite-plugin-svgr'
import { configDefaults } from 'vitest/config'
const __filename = import.meta.url.substring(
import.meta.url.lastIndexOf('/') + 1,
)
const __dirname = path.dirname(__filename)
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), svgr()],
resolve: {
alias: [{ find: 'src', replacement: path.resolve(__dirname, 'src') }],
},
server: {
port: 3000,
open: true,
host: true, // needed for the Docker Container port mapping to work
},
css: {
preprocessorOptions: {
scss: {
additionalData: '@import "src/styles/main";',
},
},
},
optimizeDeps: {
include: ['@emotion/styled'],
},
test: {
globals: true,
environment: 'jsdom',
testTimeout: 8000,
setupFiles: ['./src/config/vitest.setup.ts'],
reporters: ['default'],
coverage: {
provider: 'v8',
exclude: [
'./src/config/**',
'**/_deprecated/**',
'node_modules/**',
'**/*.test.ts',
'**/index.ts',
'**/*.d.ts',
'**/types.ts',
'**/*.types.ts',
'dist/**',
'html/**',
'**/docs/**',
'**.cjs',
'vite.config.ts',
],
reportsDirectory: 'coverage/',
},
exclude: [
...configDefaults.exclude,
'./src/config/**',
'**/_deprecated/**',
'node_modules/**',
],
},
})