-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
62 lines (55 loc) · 1.52 KB
/
vite.config.ts
File metadata and controls
62 lines (55 loc) · 1.52 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
/// <reference types="vitest" />
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
// Base path for GitHub Pages deployment
// Use repository name as base when deployed to GitHub Pages
// For custom domain or root deployment, this should be '/'
base: process.env.GITHUB_PAGES === 'true' ? '/sentinel/' : '/',
// PWA assets will be served from public directory
publicDir: 'public',
// Build configuration optimized for Node.js 22
build: {
target: 'esnext',
outDir: 'dist',
sourcemap: true,
},
// Modern JavaScript features with Node.js 22
esbuild: {
target: 'esnext',
},
// Define environment variables
define: {
__APP_REVISION__: JSON.stringify(process.env.VITE_APP_REVISION || 'dev'),
},
resolve: {
alias: {
'@': '/src',
'@/types': '/src/types',
'@/services': '/src/services',
'@/components': '/src/components',
'@/utils': '/src/utils',
},
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./tests/setup.ts'],
include: ['tests/**/*.test.{ts,tsx}'],
exclude: ['tests/integration/**/*', 'tests/performance/**/*'],
coverage: {
reporter: ['text', 'json', 'html'],
exclude: ['node_modules/', 'tests/', '*.config.{js,ts}', 'dist/'],
thresholds: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
},
},
})