0

sorry for the mistakes I've made, I'm not Englishman.

So.. First, I have Vagrant machine which is my web server with installed Yii, Ngnix, PHP etc. The vm is configured as follows:

private_network, 192.168.10.10
forwarded_port, guest: 80, host: 8080
synced_folder "www", "/srv/www", :nfs => true # !important

Second, I have Grunt which is installed on my local machine and do some tasks(watches *.scss files and converts them to css) within web root which is synced with Vagrant through nfs daemon.

I successfully do my tasks and connect to my web root through browser (localhost:8080) and everything works ok. However, I don't understand how can I implement simple reload browser page when Grunt watches my scss files and finishes to convert them into a single css file.

Could anybody give me some thoughts by simple English?

2

2 Answers 2

1

You'll want to add a browser plugin to your browser and then have watch notify it. More info here at the bottom: http://24ways.org/2013/grunt-is-not-weird-and-hard/

3
0

I solve the problem by just restarting browser! This is little instruction:

  1. Gruntfile:

    watch: {
        scss: {
            files: '<%= path.webapp %>/**/*.scss',
            tasks: ['sass'],
            options: {
                livereload: true, //! important
            },
        },
    }
    
  2. Add livereload plugin to the chrome. After CLOSE THE BROWSER!

  3. Start the task in command line: grunt watch
  4. Start the browser. And click to the livereload circle button at the top of the window.
  5. Voila! It works.

IMPORTANT: there is no reason to worry about the port and address of your 'remote' server, livereload magically detect where need to restart the page. Is works for me as localhost:8080/webapp.com and 192.168.10.10/webapp.com identically

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.