I’m just taking my first look at sage (having previously used roots). I use vagrant to build local dev boxes and I’d like to use browsersync.
The only way I’ve been able to get this to work is to create a tunnel on my host (OSX) over ssh. Is anyone else using browsersync with vagrant? Perhaps we can share tips here.
I edited my manifest.json to include my local dev URL - local.mysitename (changed to protect the innocent)
I made sure that port 3000 was open on my vagrant box.
I ran gulp watch and saw:
[BS] Proxying: http://local.mysitename
[BS] Access URLs:
----------------------------------
Local: http://localhost:3000
External: http://10.0.2.15:3000
----------------------------------
UI: http://localhost:3001
UI External: http://10.0.2.15:3001
At this point I expected to be able to enter local.mysitename:3000 in my browser and experience browsersync goodness but this didn’t work.
I think this has something to do with NAT and vagrant/virtualbox. On my host OSX, local.mysitename points to 192.168.56.101.
As a last resort, I have set up a tunnel which forwards 127.0.0.1 to 10.0.2.15 and if I browse to http://127.0.01:3000 I can see my sage site.
I also tried setting the host option in gulpfile.json to
browserSync({
proxy: config.devUrl,
host: "192.168.56.101",
snippetOptions: {...
But that didn’t work either. If anyone has any tips, please let me know.