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(minify): replace exports/defineproerty with runtime utils func #841

Merged
merged 7 commits into from
Jan 9, 2024

Conversation

stormslowly
Copy link
Member

@stormslowly stormslowly commented Jan 4, 2024

how

  • 只替换 commonjs transform 生产的 Object.defineProperty_export 调用的替换
  • 用户代码的 Object.defineProperty 不替换。
  • 严格的替换条件判断,如果未替换,只是尺寸有影响;所以也保留 cjs transform 插入的 _export 函数(如果未使用,minifiy 会删除它的)

收益

bigfish 模板项目 ~3% 的尺寸收益

2940    dist-branch     107% 
3032    dist-master     111%
2728    dist-webpack    100%

close #815
close #814

@stormslowly stormslowly force-pushed the master branch 2 times, most recently from 7ca5fd6 to d3c8cfe Compare January 4, 2024 13:19
@stormslowly stormslowly changed the title wip feat(minify): replace exports/defineproerty with runtime utils func feat(minify): replace exports/defineproerty with runtime utils func Jan 5, 2024
@sorrycc sorrycc merged commit 11a1668 into master Jan 9, 2024
8 checks passed
@delete-merged-branch delete-merged-branch bot deleted the feat/replace__exports_with_runtime_func branch January 9, 2024 02:48
@stormslowly stormslowly restored the feat/replace__exports_with_runtime_func branch March 25, 2024 05:24
@stormslowly stormslowly deleted the feat/replace__exports_with_runtime_func 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
2 participants