webpack-dev-server nfs mount file watcher

2019-06-11 15:38发布

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."

2条回答
Animai°情兽
2楼-- · 2019-06-11 15:47

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.

查看更多
SAY GOODBYE
3楼-- · 2019-06-11 16:00

Just add this options into your webpack config.

 watchOptions: {
        poll: true
 }

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

查看更多
登录 后发表回答