Is it possible to run two watch tasks simultaneously?
I understand that I can have any number of tasks I want inside watch settings and just launch grun
EDIT: concurrent now has a logConcurrentOutput
option! More info here: https://github.com/sindresorhus/grunt-concurrent#logconcurrentoutput.
Watch is a weirdly concurrent but blocking task, so you have to be creative to get multitask-like functionality working.
Concurrent loses all output from the watch tasks, which isn't ideal.
Try dynamically writing the config object in a custom task:
grunt.registerTask('watch:test', function() {
// Configuration for watch:test tasks.
var config = {
options: {
interrupt: true
},
unit: {
files: [
'test/unit/**/*.spec.coffee'
],
tasks: ['karma:unit']
},
integration: {
files: [
'test/integration/**/*.rb',
'.tmp/scripts/**/*.js'
],
tasks: ['exec:rspec']
}
};
grunt.config('watch', config);
grunt.task.run('watch');
});