BrowserSync / browser-sync

Keep multiple browsers & devices in sync when building websites. https://browsersync.io
https://discord.gg/2d2xUThp
Apache License 2.0
12.17k stars 756 forks source link

Recursive directory watching not working as expected #666

Open FaustVs opened 9 years ago

FaustVs commented 9 years ago

This issue was initially identified using the JHipster Yeoman generator, which uses BrowserSync under its Grunt build setup. I've successfully replicated the same issue externally to JHipster using one of the BrowserSync recipes as a base (but this should explain the directory structure used below). Please note that it seems Mac users of JHipster do not seem to be affected by this issue, however Windows users (of which I am one) are.

Using the Grunt+SASS base recipe, a pattern for files is setup to watch all .html files in a folder by using path src/main/webapp/**/*.html. A second pattern watch is setup for .js files for a subdirectory of the above as src/main/webapp/scripts/**/*.js.

When executed, it is observed that html files under src/main/webapp/scripts are successfully watched by BrowserSync, however files under src/main/webapp/scripts/main are not. As this is a subdirectory of the initial html watch, this seems unexpected, and as if the second pattern blocks these directories.

I have setup a fork of the recipes repository that illustrates this issue: https://github.com/FaustVs/recipes.git. Please use the Grunt+SASS example as this is the one modified. The file works.html under src/main/webapp/scripts is watched however fails.html under src/main/webapp/scripts/main does not seem to be.

I am using Windows 7, and BrowserSync 2.7.7, with Node v0.12.0. Please let me know if you require further information.

shakyShane commented 9 years ago

Cannot reproduce on OSX

Will also try on my Windows machine asap

NikitON commented 9 years ago

I have the same issue with grunt-browser-sync. All changes in .js files under pattern src/main/webapp/scripts/**/*.js are handled correctly. But .html files under pattern src/main/webapp/**/*.html are not watched. My configuration is Win8 x64, "grunt-browser-sync": "2.1.2", "grunt": "0.4.5". Partial working tree: image