How to reduce the number of JS files under assets #571
Answered
by
Mister-Hope
qiaoshouzi
asked this question in
Q&A
-
How to reduce the number of JS files under assets After one of my projects was built, 2000+ JS files are generated |
Beta Was this translation helpful? Give feedback.
Answered by
Mister-Hope
Mar 1, 2022
Replies: 1 comment
-
Currenly no, you can choose webpack as default bundler, as each page will generate 2 js files in vite, but 1 in webpack. This is for scalability concern, as you should only load a page's js chunk once you choose to navigate to it. And @meteorlxy here, some optimize could be made for vite to make sure it only generate 1 js chunk for 1 page. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Mister-Hope
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currenly no, you can choose webpack as default bundler, as each page will generate 2 js files in vite, but 1 in webpack. This is for scalability concern, as you should only load a page's js chunk once you choose to navigate to it.
And @meteorlxy here, some optimize could be made for vite to make sure it only generate 1 js chunk for 1 page.