-
-
Notifications
You must be signed in to change notification settings - Fork 757
fix: align webpack behavior of removing empty entry chunk #12414
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
Conversation
✅ Deploy Preview for rspack canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes issue #12400 by aligning rspack's behavior with webpack for removing empty entry chunks. The core change removes an overly restrictive condition in the RemoveEmptyChunksPlugin that was preventing the removal of empty chunks that had entry options.
Key changes:
- Removed the
get_entry_optionscheck from empty chunk detection logic inRemoveEmptyChunksPlugin - Added comprehensive test case
rspack-issue-12400to verify empty chunks with entry options are properly removed - Test validates that empty shared chunks (like
app~app2) are no longer created when they contain no modules
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
crates/rspack_plugin_remove_empty_chunks/src/lib.rs |
Removed get_entry_options condition to allow removal of empty chunks that are entry points, aligning with webpack behavior |
tests/rspack-test/configCases/split-chunks/rspack-issue-12400/test.config.js |
Specifies expected bundle files for test execution |
tests/rspack-test/configCases/split-chunks/rspack-issue-12400/rspack.config.js |
Configures test with split chunks and plugin to track chunk creation |
tests/rspack-test/configCases/split-chunks/rspack-issue-12400/src/app.js |
Main test file verifying empty chunks are removed |
tests/rspack-test/configCases/split-chunks/rspack-issue-12400/src/app2.js |
Second entry point for testing shared chunk behavior |
tests/rspack-test/configCases/split-chunks/rspack-issue-12400/src/async-bar.js |
Test module with dynamic imports |
tests/rspack-test/configCases/split-chunks/rspack-issue-12400/src/async-foo.js |
Simple test module with external dependency |
tests/rspack-test/configCases/split-chunks/rspack-issue-12400/src/async-async-bar.js |
Nested async module for testing deep chunk hierarchies |
tests/rspack-test/configCases/split-chunks/rspack-issue-12400/src/async-async-bar-two.js |
Additional nested async module |
tests/rspack-test/configCases/split-chunks/rspack-issue-12400/src/async-async-async-bar.js |
Deeply nested async module |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/rspack-test/configCases/split-chunks/rspack-issue-12400/src/async-foo.js
Show resolved
Hide resolved
tests/rspack-test/configCases/split-chunks/rspack-issue-12400/src/async-async-async-bar.js
Show resolved
Hide resolved
tests/rspack-test/configCases/split-chunks/rspack-issue-12400/src/async-async-bar.js
Show resolved
Hide resolved
tests/rspack-test/configCases/split-chunks/rspack-issue-12400/src/async-bar.js
Show resolved
Hide resolved
Rsdoctor Bundle Diff AnalysisFound 5 project(s) in monorepo. 📁 react-10kPath:
📦 Download Diff Report: react-10k Bundle Diff 📁 react-1kPath:
📦 Download Diff Report: react-1k Bundle Diff 📁 react-5kPath:
📦 Download Diff Report: react-5k Bundle Diff 📁 romePath:
📦 Download Diff Report: rome Bundle Diff 📁 ui-componentsPath:
📦 Download Diff Report: ui-components Bundle Diff Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
🙈 Size remains the same at 48.19MB |
CodSpeed Performance ReportMerging #12414 will not alter performanceComparing Summary
|
2b1d6c1 to
bbdf7c0
Compare
Summary
fix #12400
Align webpack's behavior of removing empty entry chunk.
Related links
Checklist