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

fix(side_effects): when use path as flag can't match resolved file #902

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

stormslowly
Copy link
Member

@stormslowly stormslowly commented Jan 31, 2024

问题

形如以下的sideEffects 配置,实例 d3-transition

"sideEffects": [
  "./src/index.js",
  "./src/selection/index.js"
],

匹配文件 side effects 时直接使用了绝对路径,那必然不匹配,所以文件副作用判定为 false,导致直接 shake 掉,副作用未生效。

  1. 匹配之前将路径转换为相对路径
  2. 将部分正则逻辑,调整为 glob 匹配逻辑

其他

一处没有必要的 move ,调整为 borrow。

@stormslowly stormslowly changed the title fix(side_effects): when use path as flag can't match resolve file fix(side_effects): when use path as flag can't match resolved file Jan 31, 2024
@sorrycc sorrycc merged commit 6df57bc into master Jan 31, 2024
8 checks passed
@delete-merged-branch delete-merged-branch bot deleted the fix/side_effect_flag_with_path_glob branch January 31, 2024 06:01
@stormslowly stormslowly restored the fix/side_effect_flag_with_path_glob branch March 25, 2024 05:24
@stormslowly stormslowly deleted the fix/side_effect_flag_with_path_glob branch August 9, 2024 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants