@@ -16,7 +16,32 @@ export default defineConfig({
1616 base : webuiPrefix ,
1717 build : {
1818 outDir : path . resolve ( __dirname , '../lightrag/api/webui' ) ,
19- emptyOutDir : true
19+ emptyOutDir : true ,
20+ rollupOptions : {
21+ output : {
22+ // Manual chunking strategy
23+ manualChunks : {
24+ // Group React-related libraries into one chunk
25+ 'react-vendor' : [ 'react' , 'react-dom' , 'react-router-dom' ] ,
26+ // Group graph visualization libraries into one chunk
27+ 'graph-vendor' : [ 'sigma' , 'graphology' , '@react-sigma/core' ] ,
28+ // Group UI component libraries into one chunk
29+ 'ui-vendor' : [ '@radix-ui/react-dialog' , '@radix-ui/react-popover' , '@radix-ui/react-select' , '@radix-ui/react-tabs' ] ,
30+ // Group utility libraries into one chunk
31+ 'utils-vendor' : [ 'axios' , 'i18next' , 'zustand' , 'clsx' , 'tailwind-merge' ] ,
32+ // Separate feature modules
33+ 'feature-graph' : [ './src/features/GraphViewer' ] ,
34+ 'feature-documents' : [ './src/features/DocumentManager' ] ,
35+ 'feature-retrieval' : [ './src/features/RetrievalTesting' ]
36+ } ,
37+ // Ensure consistent chunk naming format
38+ chunkFileNames : 'assets/[name]-[hash].js' ,
39+ // Entry file naming format
40+ entryFileNames : 'assets/[name]-[hash].js' ,
41+ // Asset file naming format
42+ assetFileNames : 'assets/[name]-[hash].[ext]'
43+ }
44+ }
2045 } ,
2146 server : {
2247 proxy : import . meta. env . VITE_API_PROXY === 'true' && import . meta. env . VITE_API_ENDPOINTS ?
0 commit comments