Skip to content

Commit 0b72385

Browse files
committed
Update bun rollupOptions to manualChunks
1 parent 3ce159b commit 0b72385

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

‎lightrag_webui/vite.config.ts‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)