Implementation:Infiniflow Ragflow Vite Config
| Knowledge Sources | |
|---|---|
| Domains | Frontend, Build_System, Configuration |
| Last Updated | 2026-02-12 06:00 GMT |
Overview
Concrete Vite build tool configuration defining proxy rules, chunk splitting, and plugin setup for the RAGFlow frontend.
Description
The vite.config.ts file configures the Vite build tool with: development server proxy rules (API and static asset proxying to backend), manual chunk splitting for optimized bundle sizes (separating vendor libraries into named chunks), SVG sprite plugin, React plugin, and path alias configuration.
Usage
This file is consumed by the Vite build process. Modify it when changing proxy targets, adding build plugins, or adjusting chunk splitting strategy.
Code Reference
Source Location
- Repository: Infiniflow_Ragflow
- File: web/vite.config.ts
- Lines: 1-186
Signature
export default defineConfig({
plugins: [react(), svgSprite()],
resolve: { alias: { '@': '/src' } },
server: {
proxy: {
'/api': { target: 'http://localhost:9380' },
'/v1': { target: 'http://localhost:9380' },
},
},
build: {
rollupOptions: {
output: { manualChunks: { ... } },
},
},
});
Import
# Consumed by Vite CLI, not imported in code
npx vite # Development server
npx vite build # Production build
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| — | — | — | Build configuration; consumed by Vite CLI |
Outputs
| Name | Type | Description |
|---|---|---|
| dist/ | directory | Production build output |
Usage Examples
cd web
npm run dev # Start Vite dev server with proxy
npm run build # Build for production with chunk splitting