glam/frontend/vite.config.ts
kempersc 505c12601a Add test script for PiCo extraction from Arabic waqf documents
- Implemented a new script `test_pico_arabic_waqf.py` to test the GLM annotator's ability to extract person observations from Arabic historical documents.
- The script includes environment variable handling for API token, structured prompts for the GLM API, and validation of extraction results.
- Added comprehensive logging for API responses, extraction results, and validation errors.
- Included a sample Arabic waqf text for testing purposes, following the PiCo ontology pattern.
2025-12-12 17:50:17 +01:00

97 lines
2.5 KiB
TypeScript

import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import path from 'path'
// https://vite.dev/config/
export default defineConfig({
logLevel: 'info',
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
build: {
// Increase chunk size warning limit (mermaid is large)
chunkSizeWarningLimit: 2000,
rollupOptions: {
output: {
// Manual chunks to separate large dependencies
manualChunks: {
maplibre: ['maplibre-gl'],
},
},
},
},
optimizeDeps: {
include: ['maplibre-gl'],
// Exclude mermaid from pre-bundling - it's dynamically imported
exclude: ['mermaid'],
},
server: {
port: 5173,
proxy: {
// PostgreSQL API proxy
'/api/postgres': {
target: 'http://localhost:3001',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/postgres/, ''),
},
// Geo API proxy (PostGIS backend on port 8002)
'/api/geo': {
target: 'http://localhost:8002',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/geo/, ''),
},
// TypeDB API proxy
'/api/typedb': {
target: 'http://localhost:8002',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/typedb/, ''),
},
// DuckLake API proxy
'/ducklake': {
target: 'http://localhost:8765',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/ducklake/, ''),
},
// RAG API proxy (Heritage RAG backend on port 8003)
'/api/rag': {
target: 'http://localhost:8003',
changeOrigin: true,
},
// Generic API fallback
'/api': {
target: 'http://localhost:8000',
changeOrigin: true,
},
// Profile entity API proxy
'/api/profile-entity': {
target: 'http://localhost:8001',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/profile-entity/, ''),
},
// Oxigraph SPARQL endpoint proxy
'/sparql': {
target: 'http://127.0.0.1:7878',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/sparql/, ''),
},
},
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: './tests/setup.ts',
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'tests/',
'**/*.test.{ts,tsx}',
'**/*.spec.{ts,tsx}',
],
},
},
});