Meteor + React + Antd - 如何加快构建/重建时间?(避免更少的插件延迟) [英] Meteor + React + Antd - How to speed up build/rebuild time? (avoid less plugin delay)
问题描述
从我的流星项目中卸载 antd 将构建时间平均减少 38-40 秒.分析器显示 plugin less 需要 >38s 来处理 antd 的巨大的 less 归档:
VELOCITY_DEBUG=1 VELOCITY_DEBUG_MIRROR=1 METEOR_PROFILE=1 流星 |少 grep...|其他插件更少......................................38,766 ms (2)...
当我卸载 antd 时,这个数字下降到 <1 秒(572 毫秒):
<代码>|其他插件较少......................................572 ms (2)
<块引用>
>在开发过程中等待应用刷新的时间太长了.
有人知道避免这种延迟的策略吗?
看来即将到来的 Meteer 更新修复了这个问题.
我更新到了最近的测试版:
meteor 更新 --release 1.7.1-beta.10
用分析器重新启动meteor:
VELOCITY_DEBUG=1 VELOCITY_DEBUG_MIRROR=1 METEOR_PROFILE=1 流星 --inspect |grep '少\|总计'
现在,less 插件的文件保存时间不到 1 秒
并且总重建时间回到合理范围内:
<代码>|│ │ ├─ 插件少45 ms (2)|(#5) 总计:4,270 毫秒(重建应用程序)
Uninstalling antd from my meteor project drops the build time by 38-40s on average. The profiler shows that plugin less needs >38s to deal with antd's huge less archive:
VELOCITY_DEBUG=1 VELOCITY_DEBUG_MIRROR=1 METEOR_PROFILE=1 meteor | grep less
...
| other plugin less.......................................38,766 ms (2)
...
this number drops to <1s (572ms) when i uninstall antd:
| other plugin less..........................................572 ms (2)
>30s is simply too long to wait for the app to refresh during development.
Does anyone know a strategy to avoid this delay?
Looks like the upcoming meteor update fixes this.
I updated to the recent beta:
meteor update --release 1.7.1-beta.10
restarted meteor with the profiler:
VELOCITY_DEBUG=1 VELOCITY_DEBUG_MIRROR=1 METEOR_PROFILE=1 meteor --inspect | grep 'less\|Total'
and now the less plugin is taking way less than 1 second on file save
and total rebuild time is back within reason:
| │ │ ├─ plugin less 45 ms (2)
| (#5) Total: 4,270 ms (Rebuild App)
这篇关于Meteor + React + Antd - 如何加快构建/重建时间?(避免更少的插件延迟)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!