Skip to content

Conversation

@Mister-Hope
Copy link
Member

No description provided.

@Mister-Hope Mister-Hope changed the title Vite/chunk split feat(bundler-vite): improve chunk split Nov 23, 2022
@Mister-Hope Mister-Hope requested a review from meteorlxy December 5, 2022 06:22
@Mister-Hope
Copy link
Member Author

Mister-Hope commented Dec 5, 2022

This should work, I found the reason why it breaks in user env.

@vuepress/client generate temp files for clientConfigs, and it includes all client entry of other plugins and theme with actaull file path, so rollup failed to recognize they are files from other pacakges, and will think those shall all included in framework chunk, so it failed to generate the correct chunk.

If we only split Vue, VueRouter and @vuepress/shared to framework, everything will be fine, and we split out a 80kb chunk to avoid update per deploy.

I try to read from app.dir.temp() and omit those internal files output @vuepress/client, but in that casae @vuepress/client becomes very "slim", and I personally think it's not worth spliting it in that case. Our main goal is to split out vue, vue-router and plugin:vite-helper as the first and second is large in app.js and the third one can actauly increase the final size if it's generated as a chunk by rollup

@meteorlxy meteorlxy merged commit b4e9ca6 into main Dec 8, 2022
@meteorlxy meteorlxy deleted the vite/chunk-split branch December 8, 2022 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants