Refactor Vite configuration and add environment type definitions
- Removed local Vite config file - Updated dev scripts to use default config - Added env.d.ts for type definitions - Enhanced Vite config with dynamic proxy - Simplified build and dev script commands
This commit is contained in:
@@ -16,5 +16,19 @@ export default defineConfig({
|
||||
build: {
|
||||
outDir: path.resolve(__dirname, '../lightrag/api/webui'),
|
||||
emptyOutDir: true
|
||||
},
|
||||
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/, '') : undefined
|
||||
}
|
||||
])
|
||||
) : {}
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user