Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(new_split_chunks): support splitChunks.{cacheGroup}.enforce #3086

Merged
merged 2 commits into from
May 10, 2023

Conversation

hyf0
Copy link
Collaborator

@hyf0 hyf0 commented May 9, 2023

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 and min_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 case reuse-chunk-name to verify the behavior of the plugin when two cache groups have the same name and enforce chunks. The changes affect the rspack_binding_options, rspack_plugin_split_chunks_new, and rspack crates, as well as the configuration schema and the test files.

Walkthrough

馃 Generated by Copilot at 374b901

  • Add a new enforce option to the cache group configuration for the split chunks plugin (link, link)
  • Import and use the SplitChunkSizes type from the new_split_chunks_plugin module (link, link)
  • Refactor the logic of mapping the raw cache group options to the CacheGroup struct (link, link, link)
  • Add a new condition to the select_cache_group function to implement the enforce logic (link)
  • Add a new test case 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)

@hyf0 hyf0 requested a review from ahabhgk May 9, 2023 10:17
@hyf0 hyf0 requested review from hardfist and h-a-n-a as code owners May 9, 2023 10:17
@hyf0 hyf0 force-pushed the hyf_23894u23j40u23j94j2 branch from 374b901 to 4e034a3 Compare May 9, 2023 10:17
@github-actions github-actions bot added release: feature team The issue/pr is created by the member of Rspack. labels May 9, 2023
@hyf0 hyf0 force-pushed the hyf_23894u23j40u23j94j2 branch from 4a1fdf2 to 8d17059 Compare May 9, 2023 14:56
@hyf0 hyf0 enabled auto-merge May 9, 2023 14:56
@hyf0 hyf0 added this pull request to the merge queue May 10, 2023
Merged via the queue into main with commit a09c2ec May 10, 2023
11 checks passed
@hyf0 hyf0 deleted the hyf_23894u23j40u23j94j2 branch May 10, 2023 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants