fix(new_split_chunks): should not care about reuseExistingChunk
if name is specified for CacheGroup
#3045
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
Blocks #3043
Align with https://github.com/webpack/webpack/blob/46cdedb4ba67aa75ccb00919e6cc8594d7445146/lib/optimize/SplitChunksPlugin.js#L1333-L1341
🤖 Generated by Copilot at a0edb96
This pull request updates and adds some test cases for the split chunks plugin in webpack, which is implemented in the rspack_plugin_split_chunks_new crate. It also simplifies the logic of finding or creating chunks for module groups in the plugin. The main goal is to improve the test coverage and the correctness of the plugin.
Walkthrough
🤖 Generated by Copilot at a0edb96
should-not-reuse-existing-chunk-simple-if-cache-group-name-specified
with a new webpack configuration filewebpack.config.js
, a new entry moduleindex.js
, and two new modulesfoo.js
andfoo-2.js
that belong to a cache group named splittedFoo (link, link, link, link)