Skip to content

Http2 defaults for splitChunks#11166

Merged
sokra merged 4 commits intomasterfrom
http2/defaults
Jul 13, 2020
Merged

Http2 defaults for splitChunks#11166
sokra merged 4 commits intomasterfrom
http2/defaults

Conversation

@sokra
Copy link
Copy Markdown
Member

@sokra sokra commented Jul 13, 2020

What kind of change does this PR introduce?
change, refactor, bugfix

Did you add tests for your changes?
yes

Does this PR introduce a breaking change?
no

What needs to be documented once your changes are merged?

  • new option splitChunks.enforceSizeThreshold resp. splitChunks.cacheGroups[x].enforceSizeThreshold
    • when over this limit, minRemainingSize, maxInitialRequests and maxAsyncRequests are ignore
    • This enforces big chunks to be splitted, e. g. big vendors, even if this adds more requests or keeps small remaining chunks
  • splitChunks.minSize defaults to 20k in production
  • splitChunks.enforceSizeThreshold default to 50k in production

sokra added 3 commits July 13, 2020 10:12
add new splitChunks.enforceSizeThreshold option
enforces splitting on certain size (ignoring maxRequests and minRemainingSize)

reduce default for splitChunks.minSize to 20k
set default for splitChunks.enforceSizeThreshold to 50k

fix bug where sorting didn't work for minSize: 0
@webpack-bot
Copy link
Copy Markdown
Contributor

webpack-bot commented Jul 13, 2020

For maintainers only:

  • This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • This needs to be backported to webpack 4 (issue will be created when merged)

@sokra
Copy link
Copy Markdown
Member Author

sokra commented Jul 13, 2020

The first commit should be backported to webpack 4, because it contains a bugfix.

@webpack-bot
Copy link
Copy Markdown
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@webpack-bot
Copy link
Copy Markdown
Contributor

I've created an issue to document this in webpack/webpack.js.org.

@webpack-bot
Copy link
Copy Markdown
Contributor

I've created an issue to backport this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants