Getting Sass –watch To Work With Vagrant on Windows Host Machine

There is a known issue with the Ruby Listen module that Sass uses to watch files. The issue stems from Listen’s ability to monitor remote mounted file systems, in this case, Vagrant on a Windows host machine.

To remedy the issue you can use the Sass --poll option with Sass. This is what the documentation says for the --poll option:

This flag, which may only be passed along with --watch, tells Sass to manually check for changes to the source files every so often instead of relying on the operating system to notify it when something changes. This may be necessary if you’re editing Sass on a remote drive where the operating system’s notification system doesn’t work.

To get Sass running with this option your watch command should look something like this:

$ sass --poll --watch scss:css

And that’s it! Happy styling!

Leave a comment

Your email address will not be published. Required fields are marked *