webpack-dev-server nfs 挂载文件观察器 [英] webpack-dev-server nfs mount file watcher

查看:27
本文介绍了webpack-dev-server nfs 挂载文件观察器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经配置了监视插件,如果我在 VM 上编辑文件,效果很好.但是,我有一个 NFS 共享,并且我在主机上编辑了我的文件.VM 上的文件观察器不会获取 NFS 共享上的更改.

I have the watching plugin configured, and if I edit files on my VM, it works great. However, I have an NFS share, and I edit my files on the host. The filewatcher on the VM does not pick up changes on the NFS share.

出于其他原因,我确实需要将此作为 NFS 共享.有什么办法可以让我完成这项工作吗?

For other reasons, I do need this to be an NFS share. Is there any way that I can make this work?

节点文档 声明您仍然可以使用 fs.watchFile,它使用 stat轮询,但速度较慢且可靠性较差."

The node docs state "You can still use fs.watchFile, which uses stat polling, but it is slower and less reliable."

推荐答案

只需将此选项添加到您的 webpack 配置中即可.

Just add this options into your webpack config.

 watchOptions: {
        poll: true
 }

你这样做是因为 Vagrant/Virtual box 文件系统挂载细节.

You have do this because of Vagrant/Virtual box filesystem mounting specifics.

这篇关于webpack-dev-server nfs 挂载文件观察器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆