fix: should handle require ensure with error function#12054
fix: should handle require ensure with error function#12054LingyuCoder merged 4 commits intomainfrom
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull Request Overview
This pull request fixes a bug in the require.ensure parser plugin and enables a previously disabled test case. The issue was an incorrect early return in the chunk name evaluation logic that prevented proper parsing of require.ensure calls.
- Fixed incorrect early return in chunk name evaluation that caused the function to exit prematurely
- Enabled the
dead-code-elimination-require-ensuretest that was previously skipped - Updated the
dead-code-eliminationtest filter message to be more specific about missing parser functionality
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/rspack-test/configCases/parsing/dead-code-elimination/test.filter.js | Updated TODO message to specify the missing parser.scope.terminated feature |
| tests/rspack-test/configCases/parsing/dead-code-elimination-require-ensure/test.filter.js | Removed test filter to enable the test case |
| crates/rspack_plugin_javascript/src/parser_plugin/require_ensure_dependencies_block_parse_plugin.rs | Fixed early return bug in chunk name evaluation logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/rspack-test/configCases/parsing/dead-code-elimination/test.filter.js
Show resolved
Hide resolved
📦 Binary Size-limit
🎉 Size decreased by 128bytes from 47.85MB to 47.85MB (⬇️0.00%) |
CodSpeed Performance ReportMerging #12054 will not alter performanceComparing Summary
|
Summary
should not stop parsing
require.ensuredirectly when get chunk name expr failed.Related links
Checklist