Simplify Vite build config by removing manual chunking strategy
• Remove manual chunk definitions • Increase chunk size warning limit • Let Vite handle chunking automatically
This commit is contained in:
parent
f402ad276c
commit
8eb0f83e86
1 changed files with 2 additions and 32 deletions
|
|
@ -17,40 +17,10 @@ export default defineConfig({
|
||||||
build: {
|
build: {
|
||||||
outDir: path.resolve(__dirname, '../lightrag/api/webui'),
|
outDir: path.resolve(__dirname, '../lightrag/api/webui'),
|
||||||
emptyOutDir: true,
|
emptyOutDir: true,
|
||||||
chunkSizeWarningLimit: 1000,
|
chunkSizeWarningLimit: 3800,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
// Handle circular dependencies and module initialization
|
// Let Vite handle chunking automatically to avoid circular dependency issues
|
||||||
external: [],
|
|
||||||
output: {
|
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'],
|
|
||||||
|
|
||||||
// Mermaid-related modules
|
|
||||||
'mermaid-vendor': ['mermaid'],
|
|
||||||
|
|
||||||
// Markdown-related modules
|
|
||||||
'markdown-vendor': [
|
|
||||||
'react-markdown',
|
|
||||||
'rehype-react',
|
|
||||||
'rehype-raw',
|
|
||||||
'remark-gfm',
|
|
||||||
'remark-math',
|
|
||||||
'react-syntax-highlighter',
|
|
||||||
'unist-util-visit'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
// Ensure consistent chunk naming format
|
// Ensure consistent chunk naming format
|
||||||
chunkFileNames: 'assets/[name]-[hash].js',
|
chunkFileNames: 'assets/[name]-[hash].js',
|
||||||
// Entry file naming format
|
// Entry file naming format
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue