fix: ASI in concatenated module only when necessary#18709
fix: ASI in concatenated module only when necessary#18709alexander-akait merged 1 commit intowebpack:mainfrom
Conversation
|
For maintainers only:
|
|
I hope we covered all possible cases 😄 maybe make sense to add more tests |
|
The current implementation is somewhat saturated. Semicolons will be added in two situations:
In other cases, ASI should be evaluated in |
|
@fi3ework Yeah, I think all works fine, just more tests for each character https://github.com/webpack/webpack/pull/18709/files#diff-d34dd78b4ea6b37ac0551517562d61f39d0fc50699240a065ec8b13b37e2ed66R176 |
|
Got it, I'll update. |
What kind of change does this PR introduce?
Only add a prefix semicolon in the concatenated module when necessary.
The fixed semicolon was introduced in #11897. The strange part is that the test case in that pull request does not work because it requires enabling
optimization.concatenateModules. Therefore, I moved the case to the config cases. The test cases will fail when I only remove the semicolon in\n;// CONCATENATED MODULE:without making any other changes, indicating that it is now functioning normally.Related tracking issue web-infra-dev/rspack#7591 (comment).
Did you add tests for your changes?
Yes.
Does this PR introduce a breaking change?
No.
What needs to be documented once your changes are merged?
No.