Added grunt watch and grunt server

This commit is contained in:
AlexKvazos
2015-04-30 13:41:54 -05:00
parent 968230622e
commit 7794cbf56d
3 changed files with 24 additions and 1 deletions
+19
View File
@@ -34,14 +34,33 @@ module.exports = function(grunt) {
options: { options: {
mangle: false mangle: false
} }
},
watch: {
client: {
files: ['app/client/**/*.js'],
tasks: ['debug']
}
},
nodemon: {
dev: {
script: ['app/server'],
options: {
watch: ['app/server']
}
}
} }
}); });
grunt.loadNpmTasks('grunt-browserify'); grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-nodemon');
grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('build', ['browserify:pro', 'uglify']); grunt.registerTask('build', ['browserify:pro', 'uglify']);
grunt.registerTask('debug', ['browserify:dev']); grunt.registerTask('debug', ['browserify:dev']);
grunt.registerTask('server', ['nodemon']);
} }
+3 -1
View File
@@ -20,4 +20,6 @@ This will start the application on port `3000` or the one specified by the `PORT
###Grunt tasks ###Grunt tasks
* `grunt debug` - Builds the client-side javascript application with no minification * `grunt debug` - Builds the client-side javascript application with no minification
* `grunt build` - Builds the client-side javascript application with minification * `grunt build` - Builds the client-side javascript application with minification
* `grunt watch` - Automatically runs `grunt debug` when client-side code changes
* `grunt server` - Starts server and automatically restart when server-side code changes
+2
View File
@@ -10,6 +10,8 @@
"grunt": "^0.4.5", "grunt": "^0.4.5",
"grunt-browserify": "^3.7.0", "grunt-browserify": "^3.7.0",
"grunt-contrib-uglify": "^0.9.1", "grunt-contrib-uglify": "^0.9.1",
"grunt-contrib-watch": "^0.6.1",
"grunt-nodemon": "^0.4.0",
"mineflayer": "git@github.com:andrewrk/mineflayer.git", "mineflayer": "git@github.com:andrewrk/mineflayer.git",
"socket.io": "^1.3.5", "socket.io": "^1.3.5",
"socket.io-redis": "^0.1.4" "socket.io-redis": "^0.1.4"