在Vagrant客户机中检测文件更改

3
我正在使用Vagrant 1.8.4,运行Ubuntu 14.04 box。我已经安装了node v6.2.2,并且在主机上运行windows 10 x64-bit,当我更改js文件并运行gulp watch / babel script.js --watch --out-file compiled.js时,客户机无法检测到更改。
我尝试了以下方法但没有成功:
 config.vm.synced_folder ".", "/var/www",          
     :nfs => true,                                 
     :mount_options => ["dmode=777", "fmode=666", "lookupcache=none"]  

and this
     :mount_options => ["dmode=777", "fmode=666", "actimeo=1"] 

请给予建议,
2个回答

7

所以我在使用 Vagrant 和一个 Angular 4 + Angular CLI 项目时遇到了同样的问题。在运行开发服务器时,文件更改不会触发文件重建和应用程序重新加载。问题在于文件系统事件未转发到 Vagrant 虚拟机。安装 vagrant-notification-forwarder Vagrant 插件为我解决了这个问题:


2

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接