La migliore e unica soluzione di lavoro è lì: https://npmjs.org/package/grunt-focus Aggiungi questo plugin e poi:
focus: {
sources: {
include: ['js', 'html', 'css', 'grunt']
},
testu: {
include: ['js', 'html', 'css', 'testu', 'grunt']
},
testi: {
include: ['js', 'html', 'css', 'testu', 'testi', 'grunt']
}
},
watch: {
js: {
files: paths.js,
tasks: ['jshint'],
options: {
livereload: true
}
},
html: {
files: paths.html,
options: {
livereload: true
}
},
css: {
files: paths.css,
tasks: ['csslint'],
options: {
livereload: true
}
},
testu: {
files: ['test/**/*.js', 'test/**/*.css'],
tasks: ['mochaTest'],
options: {}
},
testi: {
files: ['test/**/*.js', 'test/**/*.css'],
tasks: ['exec:cleanTestDB', 'protractor_webdriver', 'protractor'],
options: {}
},
grunt: {
files: ['Gruntfile.js', 'server/config/env/*.js'],
options: {
reload: true
}
}
}
quindi si utilizza fuoco: fonti o messa a fuoco: testu come vostra convenienza.
JM.
Quindi watchSet1and2 verrà eseguito quando entrambe le attività sono terminate? – chchrist
No, questo è un esempio su come eseguire entrambe le attività. Chiamerai 'grunt watchSet1And2' dalla riga di comando e inizieranno entrambi gli orologi. – jaime
Grazie, ha funzionato bene. Ho anche notato che è possibile eseguire solo attività di sorveglianza (grunt watch). Avvia compiti corretti se i file vengono modificati in una delle cartelle controllate. – markovuksanovic