-
Notifications
You must be signed in to change notification settings - Fork 63
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
[Enhance] 包体积优化 #253
Comments
除了 promisify 还有其他的吗?建议单独发 @uni/util-promisify ,防止单独一个 utils 包后面越来越臃肿。 |
有的,被引用最多的是
这几个文件
现在 utils 是以拷贝的形式放在其他包里,比如 @uni/toast@1.1.0/es/_utils/ 和 @uni/loading@1.0.7/es/_utils/,导致 webpack 打包产生了冗余代码 |
嗯 根据情况来看,接受微弱的冗余,如果某个 util 代码行数超过 n 并且被引用次数达到 m,那的确建议抽成单独的包减少冗余,这个可以定成规则。 |
promisify 我认为是非常有必要的 |
src/utils
发成 npm 包原因:在构建产物中 promisify 代码重复出现了很多次,在仓库中尝试搜索
utils/promisify
可以发现 20+ 处引用The text was updated successfully, but these errors were encountered: