Content
I develop websites with the Roots stack which utilizes Gulp + BrowserSync.
When I execute gulp watch, initially, it opens up my browser to https://localhost:300X and I see the site I'm working on - as expected.
The Goal
When I save CSS (SASS), HTML, JS or PHP, Gulp compiles and BrowserSync is suppose to refresh the page.
The Problem
Over time (couple of months), it now almost never refreshes after saving a PHP file. It rarely does it for HTML. And as of this week it's only doing it sometimes for CSS / SASS. However, still refreshes the JS consistently.
Sometimes refreshing the page manually doesn't even work.
I don't know why, and I don't know how to resolve it.
My Theory
It seems that BrowserSync is caching or something.
Further Context
To clarify:
- There are no errors output in Gulp and it appears to execute correctly.
- If I have a SASS file open and save 10 times in a row. Sometimes it will be most of those times. Other times it will only be a few times.
- I do give it a few seconds between saves because I have seen it choke if I save to rapidly.
- This is working with existing files. I have not tested with creating new files.
My Gulp.js File
https://gist.github.com/s3w47m88/5b1511ef4f2bb3c458924642da818e9a