gruntjs - How to run two grunt watch tasks simultaneously -


is possible run 2 watch tasks simultaneously?

i understand can have number of tasks want inside watch settings , launch grunt watch , watch of them, this

... watch: {     a: {         files: "js/dev/**/*.coffee",         tasks: ["coffee", "requirejs"]     },     b: {         files: "js/dev/**/*.coffee",         tasks: ["coffee"]     },     c: {         files: "js/dev/**/*.html",         tasks: ["copy"]     } } ... 

...but don't need this. want have different set of tasks development , production. can guess, difference between a (production) , b (development) minification , concatenation. don't need launch a , b tasks @ same time.

first came idea

grunt.registertask("prod", ["watch:a", "watch:c"]); grunt.registertask("dev", ["watch:b", "watch:c"]); 

but didn't work. first watch tasks working (c never works). possible want?

i've found using grunt-concurrent works:

concurrent: {   options: {     logconcurrentoutput: true   },   prod: {     tasks: ["watch:a", "watch:c"]   },   dev: {     tasks: ["watch:b", "watch:c"]   } } 

then:

grunt.registertask("prod", ["concurrent:prod"]); grunt.registertask("dev", ["concurrent:dev"]); 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -