yangdx commited on
Commit
7e03dcc
·
1 Parent(s): 93c2391

Update bun rollupOptions to manualChunks

Browse files
Files changed (1) hide show
  1. lightrag_webui/vite.config.ts +26 -1
lightrag_webui/vite.config.ts CHANGED
@@ -16,7 +16,32 @@ export default defineConfig({
16
  base: webuiPrefix,
17
  build: {
18
  outDir: path.resolve(__dirname, '../lightrag/api/webui'),
19
- emptyOutDir: true
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  },
21
  server: {
22
  proxy: import.meta.env.VITE_API_PROXY === 'true' && import.meta.env.VITE_API_ENDPOINTS ?
 
16
  base: webuiPrefix,
17
  build: {
18
  outDir: path.resolve(__dirname, '../lightrag/api/webui'),
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
+ }
45
  },
46
  server: {
47
  proxy: import.meta.env.VITE_API_PROXY === 'true' && import.meta.env.VITE_API_ENDPOINTS ?