Skip to content

Commit

Permalink
Manually split chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
lubej committed Apr 2, 2024
1 parent 1cdc798 commit 14377e2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,25 @@ import { visualizer } from 'rollup-plugin-visualizer'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [svgr(), react(), splitVendorChunkPlugin(), visualizer() as PluginOption],
build: {
sourcemap: true,
rollupOptions: {
output: {
manualChunks(id: string) {
if (id.includes('ethers')) {
return 'ethers'
}
if (id.includes('recharts')) {
return 'recharts'
}
if (id.includes('lodash')) {
return 'lodash'
}
if (id.includes('react-dom')) {
return 'react-dom'
}
},
},
},
},
})

0 comments on commit 14377e2

Please sign in to comment.