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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(new_split_chunks): support splitChunks.name #2955

Merged
merged 4 commits into from
May 5, 2023
Merged

Conversation

hyf0
Copy link
Collaborator

@hyf0 hyf0 commented Apr 27, 2023

Related issue (if exists)

Summary

  • migrate split-chunks-common/simple of Webpack
  • Support splitChunks.name

🤖 Generated by Copilot at 0564b81

This pull request adds support for naming chunks and cache groups in the split chunks plugin of rspack, a web development tool. It introduces a new name field to the user configuration and the internal options, and a new ChunkNameGetter function to generate chunk names. It also adds and modifies some test cases to demonstrate the new feature and fix some minor issues.

Walkthrough

🤖 Generated by Copilot at 0564b81

  • Add a name field to the split chunks options and cache groups, and use it to assign names to the chunks based on the modules they contain (link, link, link, link, link, link)
  • Add a key field to the cache groups, and use it to identify and merge modules that belong to the same cache group (link, link)
  • Change the ChunkNameGetter type from a Box to an Arc, and add a function to create an empty ChunkNameGetter that returns None (link, link)
  • Add a new test case split-chunks-common/simple that uses the name field to create a single vendor chunk that contains the a.js module (link, link, link, link)
  • Add a new test case split-chunks/split-chunks-dot-name that uses the name field and cache groups to create a single chunk that contains the foo.js and foo-2.js modules, and does not treat the dot in the name as a separator (link, link, link, link)
  • Remove a console log statement from the split-chunks/extract-css-to-single-chunk test case (link)

@changeset-bot
Copy link

changeset-bot bot commented Apr 27, 2023

🦋 Changeset detected

Latest commit: ac6cac0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@rspack/binding Patch
@rspack/postcss-loader Patch
@rspack/core Patch
webpack-test Patch
@rspack/cli Patch
@rspack/dev-middleware Patch
@rspack/dev-server Patch
@rspack/plugin-html Patch
benchmarkcase-rspack-react-refresh Patch
@rspack/dev-client Patch
@rspack/plugin-minify Patch
@rspack/plugin-node-polyfill Patch
@rspack/binding-darwin-arm64 Patch
@rspack/binding-darwin-x64 Patch
@rspack/binding-linux-x64-gnu Patch
@rspack/binding-win32-x64-msvc Patch
@rspack/fs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Apr 27, 2023
@hyf0

This comment was marked as outdated.

@hyf0 hyf0 changed the title test(split_chunks): migrate split-chunks-common/simple feat(new_split_chunks): support splitChunks.name May 5, 2023
@hyf0 hyf0 marked this pull request as ready for review May 5, 2023 06:29
@hyf0 hyf0 requested review from hardfist and h-a-n-a as code owners May 5, 2023 06:29
@hyf0 hyf0 enabled auto-merge May 5, 2023 06:43
@hyf0 hyf0 added this pull request to the merge queue May 5, 2023
Merged via the queue into main with commit ff85ce8 May 5, 2023
@hyf0 hyf0 deleted the hyf_2834e2390840928340 branch May 5, 2023 11:01
This was referenced May 9, 2023
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.

3 participants