-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
116 lines (115 loc) · 2.93 KB
/
vitest.config.ts
File metadata and controls
116 lines (115 loc) · 2.93 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
plugins: [
react(),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.svg', 'apple-touch-icon.png', 'mask-icon.svg'],
manifest: {
name: 'SAGA Spells Manager',
short_name: 'SAGA Spells',
description: 'A spell manager for SAGA TTRPG with advanced filtering and spellbook organization capabilities',
theme_color: '#4c6ef5',
icons: [
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png'
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png'
}
]
}
}),
],
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
build: {
target: 'es2020',
outDir: 'dist',
assetsDir: 'assets',
minify: 'terser',
rollupOptions: {
output: {
manualChunks: {
'react-vendor': ['react', 'react-dom', 'react-router-dom'],
'mantine-core': ['@mantine/core', '@mantine/hooks'],
'mantine-extras': [
'@mantine/dates',
'@mantine/form',
'@mantine/modals',
'@mantine/notifications',
],
'pdf-vendor': ['jspdf', 'jspdf-autotable', 'html2canvas'],
'data-vendor': ['@tanstack/react-query', '@tanstack/react-table', 'zod'],
'icons': ['@tabler/icons-react'],
}
},
},
emptyOutDir: true,
reportCompressedSize: true,
sourcemap: false,
cssCodeSplit: true,
manifest: true,
},
optimizeDeps: {
include: [
'react',
'react-dom',
'react-router-dom',
'@mantine/core',
'@mantine/hooks',
],
},
server: {
open: true,
port: 5173,
},
preview: {
port: 5174,
open: true,
headers: {
'Alt-Svc': 'h3=":443"; ma=86400',
'Cache-Control': 'public, max-age=31536000, immutable',
},
}, test: {
globals: true,
environment: 'happy-dom',
setupFiles: './src/test/setup.ts',
coverage: {
provider: 'v8', // Using V8 coverage provider
reporter: ['text', 'html', 'lcov', 'json'], // Multiple report formats
exclude: [
'node_modules/**',
'**/*.d.ts',
'**/dist/**',
'**/*.test.{ts,tsx}',
'**/*.spec.{ts,tsx}',
'**/test/**',
'**/.vscode/**',
'**/codeql-database/**',
'**/vitest.config.ts',
'**/vite.config.ts',
'src/main.tsx',
],
reportsDirectory: './coverage',
all: true // Include non-tested files in report
// thresholds disabled while developing tests
// thresholds: {
// lines: 70,
// branches: 70,
// functions: 70,
// statements: 70
// }
}
}
});