Skip to content

Commit

Permalink
refactor: 优化vite在打包时分块打包
Browse files Browse the repository at this point in the history
  • Loading branch information
kanyxmo committed Sep 19, 2023
1 parent e78e650 commit 80e3533
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@ export default ({ mode }) => {
},

build: {
chunkSizeWarningLimit: 3000,
chunkSizeWarningLimit: 1500,
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
return id.toString().split("node_modules/")[1].split("/")[0].toString();
}
}
}
}
},

server: {
Expand Down

0 comments on commit 80e3533

Please sign in to comment.