Update bun rollupOptions to manualChunks
This commit is contained in:
@@ -16,7 +16,32 @@ export default defineConfig({
|
|||||||
base: webuiPrefix,
|
base: webuiPrefix,
|
||||||
build: {
|
build: {
|
||||||
outDir: path.resolve(__dirname, '../lightrag/api/webui'),
|
outDir: path.resolve(__dirname, '../lightrag/api/webui'),
|
||||||
emptyOutDir: true
|
emptyOutDir: true,
|
||||||
|
rollupOptions: {
|
||||||
|
output: {
|
||||||
|
// Manual chunking strategy
|
||||||
|
manualChunks: {
|
||||||
|
// Group React-related libraries into one chunk
|
||||||
|
'react-vendor': ['react', 'react-dom', 'react-router-dom'],
|
||||||
|
// Group graph visualization libraries into one chunk
|
||||||
|
'graph-vendor': ['sigma', 'graphology', '@react-sigma/core'],
|
||||||
|
// Group UI component libraries into one chunk
|
||||||
|
'ui-vendor': ['@radix-ui/react-dialog', '@radix-ui/react-popover', '@radix-ui/react-select', '@radix-ui/react-tabs'],
|
||||||
|
// Group utility libraries into one chunk
|
||||||
|
'utils-vendor': ['axios', 'i18next', 'zustand', 'clsx', 'tailwind-merge'],
|
||||||
|
// Separate feature modules
|
||||||
|
'feature-graph': ['./src/features/GraphViewer'],
|
||||||
|
'feature-documents': ['./src/features/DocumentManager'],
|
||||||
|
'feature-retrieval': ['./src/features/RetrievalTesting']
|
||||||
|
},
|
||||||
|
// Ensure consistent chunk naming format
|
||||||
|
chunkFileNames: 'assets/[name]-[hash].js',
|
||||||
|
// Entry file naming format
|
||||||
|
entryFileNames: 'assets/[name]-[hash].js',
|
||||||
|
// Asset file naming format
|
||||||
|
assetFileNames: 'assets/[name]-[hash].[ext]'
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
proxy: import.meta.env.VITE_API_PROXY === 'true' && import.meta.env.VITE_API_ENDPOINTS ?
|
proxy: import.meta.env.VITE_API_PROXY === 'true' && import.meta.env.VITE_API_ENDPOINTS ?
|
||||||
|
Reference in New Issue
Block a user