LightRAG/lightrag_webui/vite.config.ts
clssck 59e89772de refactor: consolidate to PostgreSQL-only backend and modernize stack
Remove legacy storage implementations and deprecated examples:
- Delete FAISS, JSON, Memgraph, Milvus, MongoDB, Nano Vector DB, Neo4j, NetworkX, Qdrant, Redis storage backends
- Remove Kubernetes deployment manifests and installation scripts
- Delete unofficial examples for deprecated backends and offline deployment docs
Streamline core infrastructure:
- Consolidate storage layer to PostgreSQL-only implementation
- Add full-text search caching with FTS cache module
- Implement metrics collection and monitoring pipeline
- Add explain and metrics API routes
Modernize frontend and tooling:
- Switch web UI to Bun with bun.lock, remove npm and pnpm lockfiles
- Update Dockerfile for PostgreSQL-only deployment
- Add Makefile for common development tasks
- Update environment and configuration examples
Enhance evaluation and testing capabilities:
- Add prompt optimization with DSPy and auto-tuning
- Implement ground truth regeneration and variant testing
- Add prompt debugging and response comparison utilities
- Expand test coverage with new integration scenarios
Simplify dependencies and configuration:
- Remove offline-specific requirement files
- Update pyproject.toml with streamlined dependencies
- Add Python version pinning with .python-version
- Create project guidelines in CLAUDE.md and AGENTS.md
2025-12-12 16:28:49 +01:00

59 lines
2 KiB
TypeScript

import tailwindcss from '@tailwindcss/vite'
import react from '@vitejs/plugin-react-swc'
import path from 'path'
import { defineConfig } from 'vite'
import { webuiPrefix } from '@/lib/constants'
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
// Force all modules to use the same React and katex instances
// This prevents "Invalid hook call" errors from duplicate React copies
dedupe: ['react', 'react-dom', 'katex'],
},
// base: import.meta.env.VITE_BASE_URL || '/webui/',
base: webuiPrefix,
build: {
outDir: path.resolve(__dirname, '../lightrag/api/webui'),
emptyOutDir: true,
chunkSizeWarningLimit: 3800,
rollupOptions: {
// Let Vite handle chunking automatically to avoid circular dependency issues
output: {
// Ensure consistent chunk naming format
chunkFileNames: 'assets/[name]-[hash].js',
// Entry file naming format
entryFileNames: 'assets/[name]-[hash].js',
// Asset file naming format
assetFileNames: 'assets/[name]-[hash].[ext]',
},
},
},
server: {
proxy:
import.meta.env.VITE_API_PROXY === 'true' && import.meta.env.VITE_API_ENDPOINTS
? Object.fromEntries(
import.meta.env.VITE_API_ENDPOINTS.split(',').map((endpoint) => [
endpoint,
{
target: import.meta.env.VITE_BACKEND_URL || 'http://localhost:9621',
changeOrigin: true,
rewrite:
endpoint === '/api'
? (path) => path.replace(/^\/api/, '')
: endpoint === '/docs' ||
endpoint === '/redoc' ||
endpoint === '/openapi.json' ||
endpoint === '/static'
? (path) => path
: undefined,
},
])
)
: {},
},
})