Webpack doesn't reload automatically in Vagrant/VirtualBox
(Opening this as an issue rather than a PR to see if there's a reason for the existing behavior. If not, feel free to cherry-pick https://github.com/aschmitz/mastodon/commit/f866b860351e871b41b62ce8faff312c9b56c418 or I can open a PR.)
In Vagrant on macOS and Linux (I'm unsure about Windows), Vagrant + VirtualBox uses NFS to share the shared /vagrant folder. The way this is configured does not support inotify, so webpack doesn't notice that its JavaScript files have changed.
This can be "fixed" by setting a poll key inside the watchOptions object on the devServer config for webpack, with the frequency with which webpack should check for updates. On my development computer, a frequency of 1000 (once a second) appears to keep CPU usage low and still feels vaguely responsive, but a higher number (2000-3000) may be desirable if many developers are using slower computers or hard drives rather than SSDs. The delay in updating is dominated by the recompilation time regardless.
As I said, I'm not sure if there's a reason for avoiding this behavior, so I wanted to solicit opinions before actually opening a PR, but the fix is simple enough if someone wants to just go ahead and make it or cherry-pick it.
- [x] I searched or browsed the repo’s other issues to ensure this is not a duplicate.
- [x] This bug happens on a tagged release and not on
master(If you're a user, don't worry about this).
Worth noting #1948 in relation to this
pretty sure you can open a PR with that, yeah.
Shouldn't this one be closed? I can see a merged PR here.