Skip to content

Commit

Permalink
chore: chunk optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
Ray-D-Song committed Oct 31, 2024
1 parent 803c4f1 commit 851fb27
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/preview-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Deploy-Preview
on:
push:
branches:
- dev
- main
- hotfix
- chunk

jobs:
deploy:
Expand Down
6 changes: 6 additions & 0 deletions packages/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ export default defineConfig({
output: {
entryFileNames: 'index.js',
assetFileNames: 'index.css',
chunkFileNames: 'assets/[name]-[hash].js',
manualChunks: {
'react-vendor': ['react', 'react-dom', 'react-router-dom'],
'radix-ui': ['@radix-ui/react-checkbox', '@radix-ui/react-collapsible', '@radix-ui/react-context-menu', '@radix-ui/react-dialog', '@radix-ui/react-dropdown-menu', '@radix-ui/react-label', '@radix-ui/react-scroll-area', '@radix-ui/react-select', '@radix-ui/react-separator', '@radix-ui/react-slot', '@radix-ui/react-switch', '@radix-ui/react-tooltip'],
'recharts': ['recharts'],
},
},
},
outDir: '../../dist/service/src/static',
Expand Down

0 comments on commit 851fb27

Please sign in to comment.