mastodon icon indicating copy to clipboard operation
mastodon copied to clipboard

Webpack doesn't reload automatically in Vagrant/VirtualBox

Open aschmitz opened this issue 8 years ago • 3 comments

(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).

aschmitz avatar Sep 15 '17 13:09 aschmitz

Worth noting #1948 in relation to this

ineffyble avatar Sep 20 '17 23:09 ineffyble

pretty sure you can open a PR with that, yeah.

wxcafe avatar Sep 21 '17 01:09 wxcafe

Shouldn't this one be closed? I can see a merged PR here.

bryszard avatar Dec 17 '22 14:12 bryszard