58 lines
1.4 KiB
TypeScript
Executable file
58 lines
1.4 KiB
TypeScript
Executable file
import { resolve } from 'node:path'
|
|
import { defineConfig } from 'vitest/config'
|
|
import react from '@vitejs/plugin-react-swc'
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
test: {
|
|
include: ['src/**/*.{test,spec}.?(c|m)[jt]s?(x)'],
|
|
exclude: ['node_modules/**', 'tests/e2e/**', 'dist/**', 'coverage/**'],
|
|
environment: 'jsdom',
|
|
setupFiles: './src/test/setupTests.ts',
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'json-summary', 'html'],
|
|
reportsDirectory: './coverage',
|
|
thresholds: {
|
|
statements: 49,
|
|
branches: 50,
|
|
functions: 33,
|
|
lines: 49
|
|
}
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, './src')
|
|
}
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': {
|
|
target: process.env.VITE_FAMILIAROS_URL || 'http://localhost:3000',
|
|
changeOrigin: true
|
|
},
|
|
|
|
|
|
|
|
|
|
}
|
|
},
|
|
optimizeDeps: {
|
|
include: ['react', 'react-dom', '@monaco-editor/react', 'monaco-editor']
|
|
},
|
|
build: {
|
|
// Keep warning noise low while preserving stable default chunk graph.
|
|
chunkSizeWarningLimit: 4000,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (id.includes('monaco-editor') || id.includes('@monaco-editor')) return 'monaco-editor';
|
|
if (id.includes('@excalidraw')) return 'excalidraw';
|
|
// Avoid aggressive splitting for other node_modules to prevent CJS/ESM wrapper issues.
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|