grunt-contrib-watch icon indicating copy to clipboard operation
grunt-contrib-watch copied to clipboard

options.atBegin doesn't work

Open smarts opened this issue 9 years ago • 1 comments

My understanding is that specifying true for options.atBegin should run all the tasks specified in the watch task when the watcher starts.

gruntfile.js

module.exports = function (grunt) {
  grunt.initConfig({
    less: {
      development: {
        files: { 'styles/main.min.css': 'styles/main.less' }
      }
    },
    watch: {
      css: {
        files: 'styles/*.less',
        tasks: 'less'
      },
      thisFile: {
        files: 'gruntfile.js'
      },
      options: {
        atBegin: true
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-contrib-watch');

  grunt.registerTask('default', ['watch']);
};

When i change gruntfile.js i expect the CSS file to be regenerated, which doesn't happen

FYI: Windows 8.1 - node v0.12.7 - grunt v0.4.5 - grunt-contrib-watch 0.6.1

smarts avatar Aug 19 '15 16:08 smarts

hmm apparently it doesn't work as a global option but does at the task level. is that the desired behavior?

smarts avatar Aug 19 '15 18:08 smarts