gruntjs / grunt-contrib-watch

Run tasks whenever watched files change.
http://gruntjs.com/
MIT License
1.98k stars 356 forks source link

Not an issue but a question of why you would need to watch a grunt task vs saving #441

Open xtianus79 opened 9 years ago

xtianus79 commented 9 years ago

here is the snippet of code in question: oh and awesome product by the way

watch: {
        grunt: {
            files: ['Gruntfile.js'],
            tasks: ['sass']
        },
        sass: {
                files: '<%= app %>/scss/**/*.scss',
                tasks: ['sass']
        },
        livereload: {
            files: ['<%= app %>/**/*.html', '!<%= app %>/bower_components/**', '<%= app %>/js/**/*.js', '<%= app %>/css/**/*.css', '<%= app %>/images/**/*.{jpg,gif,svg,jpeg,png}'],
            options: {
                livereload: true
            }
        }
    },

I get the sass: watching which is basically save but what would be the purpose of watching a grunt task.

cadje commented 9 years ago

Basically a sass task for a js files makes no sense at all rather jshint or jslint, but watching a grunt file could be really helpful. For instance, when you are working on a complex tasksequence then you don't have to reload grunt via command line every time you change something...