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

优化仅 zh-CN 语言应用的打包体积 #6592

Merged
merged 2 commits into from
Apr 9, 2024

Conversation

guoyunhe
Copy link
Contributor

@guoyunhe guoyunhe commented Apr 9, 2024

有很多应用只支持 zh-CN,而由于 mergeLocale 的存在,导致 base (英文)也会被打包进去,徒增 3KB 的体积。本项目的维护者几乎都是 zh-CN 语言使用者,zh-CN 语言的完整性是有保证的,因此并不需要 mergeLocale 兜底,因此在 zh-CN 语言中去掉了 mergeLocale。

Copy link
Contributor

github-actions bot commented Apr 9, 2024

Size Change: -1.4 kB (0%)

Total Size: 352 kB

Filename Size Change
./lib/bundle/antd-mobile.compatible.umd.js 189 kB -662 B (0%)
./lib/bundle/antd-mobile.umd.js 144 kB -736 B (-1%)
ℹ️ View Unchanged
Filename Size
./lib/bundle/css-vars-patch.css 1.43 kB
./lib/bundle/style.css 18 kB

compressed-size-action

Copy link
Contributor

github-actions bot commented Apr 9, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
./lib/bundle/antd-mobile.es.js 136.92 KB (-394 B 🔽) 2.8 s (-0.29% 🔽) 196 ms (+40.78% 🔺) 3 s

Copy link
Contributor

github-actions bot commented Apr 9, 2024

PR preview has been successfully built and deployed to https://antd-mobile-preview-pr-6592.surge.sh

@zombieJ
Copy link
Member

zombieJ commented Apr 9, 2024

如果这么写的话,需要搞个测试用例确保两者的 key 是幂等的

@guoyunhe
Copy link
Contributor Author

guoyunhe commented Apr 9, 2024

如果这么写的话,需要搞个测试用例确保两者的 key 是幂等的

@zombieJ 已补充测试用例

@zombieJ zombieJ merged commit d4ff76b into master Apr 9, 2024
8 checks passed
@zombieJ zombieJ deleted the optimize-locale-tree-shaking branch April 9, 2024 13:39
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