I have this VagrantFile:
Vagrant.configure("2") do |config|
# Use Ubuntu 14.04 Trusty Tahr 64-bit as our operating system
config.vm.box = "ubuntu/trusty64"
# Configurate the virtual machine to use 2GB of RAM
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
end
# Forward the Rails server default port to the host
config.vm.network :forwarded_port, guest: 4200, host: 4200
config.vm.network :forwarded_port, guest: 35729, host: 35729
Everything works good, in my Windows I can visit http://localhost:4200
and it works. But, there is a big but.
I have the ember's project files in a Windows folder shared with vagrant.
If I save files of my ember's project in Windows I can't have livereload, and in my vagrant ssh
I even can't view the changes detected.
If I go with vagrant ssh
and use nano application.hbs
and then save something new it detect changes and livereload works in my Chrome's window on Windows.
What the hell is the problem?
The way Vagrant syncs directories between your desktop and the VM will break the default mechanism ember-cli uses to watch files and cause issues when updates are subsequently compiled.
To restore this functionality, you can either add the following lines to the '.ember-cli' file
"liveReload": true,
"watcher": "polling"
or invoke the serve command using the fallback polling watcher.
ember serve --watcher polling