webpack-dev-server nfs mount file watcher

丶灬走出姿态 提交于 2019-12-08 12:39:39

问题


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.

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

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


回答1:


I fixed this problem with Ubuntu 14.04 running on Oracle VM VirtualBox on Windows 8.1 using:

  plugins: [
    new webpack.OldWatchingPlugin(),
    new webpack.HotModuleReplacementPlugin()
  ]

I think there's a decent chance this will also fix the issue with other configurations.




回答2:


Just add this options into your webpack config.

 watchOptions: {
        poll: true
 }

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



来源:https://stackoverflow.com/questions/29954774/webpack-dev-server-nfs-mount-file-watcher

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