项目中 san-cli 升级到 4.0 一直不断重复编译, #668
jinjingxuan
started this conversation in
San CLI
Replies: 2 comments
-
san-cli 热更新的方式一般是监听文件系统的事件,有的情况这种方式会失效,所以设置轮询作为兜底方案。 |
Beta Was this translation helpful? Give feedback.
0 replies
-
你可以先把轮询关掉来临时解决这个问题: // san.config.js
module.exports = {
devServer: {
watchOptions: {
poll: false
}
}
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
项目首次启动没有问题,但是只要修改一次代码保存后,控制台就一直在不断刷新。
![image](https://user-images.githubusercontent.com/38754734/130202488-b30c7802-b54f-4f9d-b18b-1ac601e9c06e.png)
此外我看控制台热更新的 websocket 也在不断推送消息,hash 值没变。
![image](https://user-images.githubusercontent.com/38754734/130205197-6062975a-9165-4d79-bcbb-ddfbbf1e1769.png)
看了一下 san-cli 默认配置文件,感觉是 watchOptions 中的 poll 轮询的原因,然后我把 poll 属性删了就可以了,有几个问题:
Beta Was this translation helpful? Give feedback.
All reactions