Watching files for changes on Vagrant, file modification times not updating

做~自己de王妃 提交于 2019-12-06 05:48:31

They are indeed linked. It appears to be to do with NFS caching details about files.

With gulp-watch running, we could edit a file from the host which was being watched by the guest, and it would not be noticed. But then as soon as the file was accessed by the guest (for instance with cat file.less) the gulp-watch process would see the updated modification date and run its tasks.

The solution in the end was to give Vagrant a hint to mount the NFS share with the lookupcache=none option.

To do this, a line in our Vagrantfile changed from

config.vm.synced_folder "./", "/vagrant", type: "nfs"

to

config.vm.synced_folder "./", "/vagrant", type: "nfs", mount_options: ["lookupcache=none"]

Changes are now picked up immediately.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!