gruntjs - Watch only css changes with grunt -


i have basic project setup index.html , styles.css in root folder. want changes .css file cause automatic refresh in browser everytime click save. content of gruntfile.js:

module.exports = function(grunt) {    // project configuration.   grunt.initconfig({     pkg: grunt.file.readjson('package.json'),     watch: {       styles: {               files: ['styles.css'],               options: {                   livereload: true               }           },       },   });    grunt.loadnpmtasks('grunt-contrib-watch');    // default task(s).   grunt.registertask('default', ['watch']);  }; 

but, when run grunt watch in cmd, get:

>> file "styles.css" changed. warning: task "css" not found. use --force continue. aborted due warnings.

what doing wrong?

basically livereload declaration nested wrong, , discussed above "styles" erroneous, think should work you:

module.exports = function(grunt) {    // project configuration.   grunt.initconfig({     pkg: grunt.file.readjson('package.json'),     watch: {       livereload:  {         options: {         livereload: true       },       files: [         'styles.css'       ]       }     }   });    grunt.loadnpmtasks('grunt-contrib-watch');    // default task(s).   grunt.registertask('default', ['watch']);  }; 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -