Skip to content

Commit

Permalink
Issue #344 : Add watch:dev task to rebuild sprites
Browse files Browse the repository at this point in the history
  • Loading branch information
juliandescottes committed Nov 30, 2015
1 parent 8aa6eff commit dd1d2bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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']);
};
Empty file.

0 comments on commit dd1d2bf

Please sign in to comment.