feat(new_split_chunks): support splitChunks.{cacheGroup}.enforce
#3086
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related issue (if exists)
Summary
See https://webpack.js.org/plugins/split-chunks-plugin/#splitchunkscachegroupscachegroupenforce
馃 Generated by Copilot at 374b901
This pull request adds support for the
enforce
andmin_size
options for cache groups in the split chunks plugin, which allow creating chunks for specific modules regardless of the global split chunks options. It also adds a new test casereuse-chunk-name
to verify the behavior of the plugin when two cache groups have the same name and enforce chunks. The changes affect therspack_binding_options
,rspack_plugin_split_chunks_new
, andrspack
crates, as well as the configuration schema and the test files.Walkthrough
馃 Generated by Copilot at 374b901
enforce
option to the cache group configuration for the split chunks plugin (link, link)SplitChunkSizes
type from thenew_split_chunks_plugin
module (link, link)CacheGroup
struct (link, link, link)select_cache_group
function to implement theenforce
logic (link)reuse-chunk-name
to test the behavior of the split chunks plugin when two cache groups have the same name and enforce the creation of chunks (link, link, link, link, link)