workorder-desk/frontend/vite.config.ts

41 lines
No EOL
1.1 KiB
TypeScript

/// <reference types="vitest/config" />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
const proxyTarget: string = process.env.VITE_PROXY_TARGET ?? 'http://localhost:4000';
export default defineConfig({
plugins: [react()],
server: {
port: 5173,
proxy: {
'/api': { target: proxyTarget, changeOrigin: true },
'/health': { target: proxyTarget, changeOrigin: true },
'/ready': { target: proxyTarget, changeOrigin: true },
},
},
test: {
environment: 'jsdom',
globals: true,
setupFiles: ['./src/test/setup.ts'],
css: false,
coverage: {
provider: 'v8',
reporter: ['text', 'lcov'],
// Business logic modules — the threshold applies to included files.
include: [
'src/lib/**/*.{ts,tsx}',
'src/hooks/**/*.{ts,tsx}',
'src/api/**/*.{ts,tsx}',
'src/features/**/queries.ts',
],
exclude: ['src/**/*.test.{ts,tsx}'],
thresholds: {
statements: 60,
branches: 50,
functions: 60,
lines: 60,
},
},
},
});