Grunt: Watch multiple files, Compile only Changed

前端 未结 4 1608
悲哀的现实
悲哀的现实 2020-12-05 06:28

I\'m new to Grunt, and so far I\'m enjoying it very much. I want Grunt to compile only the changed files when running grunt watch

In my Grunfile.coffee

4条回答
  •  北海茫月
    2020-12-05 07:21

    I've finally found a real solution! And it's super simple too!

    npm install grunt-newer --save-dev

    Then in your Gruntfile (after loading the task in grunt):

    watch:
        coffeescript:
            files: 'assets/javascript/**/*.coffee'
            tasks: ["newer:coffee"]
    

    And that's it! The Awesome grunt-newer is awesome!

提交回复
热议问题