Skip to content

Same dependencies are bundled multiple times (once per page) #4721

Answered by slorber
sdirix asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

This is definitively not the behavior we want and not sure why this happens.

We upgraded to Webpack 5 in alpha 75, maybe try to upgrade and see if it improves? (I don't think it will).

This problem is related to our code splitting config, which is far from perfect IMHO but it not so easy to fine-tune (there's good inspiration to take from Next.js here as they worked with Chrome team to improve their).

https://webpack.js.org/plugins/split-chunks-plugin/

Our current config is:

{
            name: false,
            cacheGroups: {
              default: false,
              common: {
                name: 'common',
                minChunks: totalPages > 2 ? totalPages * 0.5 : 2,

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@sdirix
Comment options

@TheZoker
Comment options

Answer selected by sdirix
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@slorber
Comment options

slorber May 6, 2021
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants