openpetswithchatandmcp/website/vite.config.js
OpenPets Dev 65ac83849e Add 'website/' from commit '966aea480ffe1c340553aa878def30131d2af827'
git-subtree-dir: website
git-subtree-mainline: 8d3849caea
git-subtree-split: 966aea480f
2026-06-17 20:48:39 +00:00

55 lines
1.7 KiB
JavaScript
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_SCRIPTORIUM_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: function (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.
}
}
}
}
});