Issue #344 : Add watch:dev task to rebuild sprites

This commit is contained in:
jdescottes 2015-11-29 22:05:41 +01:00
parent 8aa6eff715
commit dd1d2bf441
2 changed files with 12 additions and 5 deletions

View File

@ -118,11 +118,17 @@ module.exports = function(grunt) {
path : 'http://' + ip + ':9901/?debug'
}
},
watch: {
scripts: {
prod: {
files: ['src/**/*.*'],
tasks: ['merge'],
tasks: ['build'],
options: {
spawn: false
}
},
dev: {
files: ['src/img/**/*.*'],
tasks: ['sprite'],
options: {
spawn: false
}
@ -270,15 +276,16 @@ module.exports = function(grunt) {
// Validate & Build
grunt.registerTask('default', ['clean:before', 'lint', 'build']);
grunt.registerTask('caca', ['sprite']);
// Build stand alone app with nodewebkit
grunt.registerTask('desktop', ['default', 'nodewebkit:windows']);
grunt.registerTask('desktop-mac', ['default', 'nodewebkit:macos']);
// Start webserver and watch for changes
grunt.registerTask('serve', ['build', 'express:regular', 'open:regular', 'express-keepalive', 'watch']);
grunt.registerTask('serve', ['build', 'express:regular', 'open:regular', 'watch:prod']);
// Start webserver on src folder, in debug mode
grunt.registerTask('serve-debug', ['express:debug', 'open:debug', 'express-keepalive']);
grunt.registerTask('serve-debug', ['sprite', 'express:debug', 'open:debug', 'watch:dev']);
grunt.registerTask('play', ['serve-debug']);
};