From dadf0ae1a54ce13dfdf294bb94b1db06e5b7a9b5 Mon Sep 17 00:00:00 2001 From: jdotzki Date: Wed, 12 Mar 2014 10:59:06 +0100 Subject: [PATCH] chore(Gruntfile): add auto-build task --- Gruntfile.js | 22 +++++++++++++++++++++- package.json | 1 + 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 5792e149..2a94d8bb 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -113,13 +113,33 @@ module.exports = function(grunt) { concurrent: { 'sources': [ 'browserify:src', 'jshint' ], 'build': [ 'jshint', 'build', 'jsdoc' ] - } + }, + connect: { + options: { + port: 9003, + livereload: 35726, + hostname: 'localhost' + }, + livereload: { + options: { + open: true, + base: [ + '<%= config.dist %>' + ] + } + } + }, }); // tasks grunt.registerTask('test', [ 'jasmine_node', 'karma:single' ]); grunt.registerTask('build', [ 'browserify', 'copy:samples' ]); + grunt.registerTask('auto-build', [ + 'concurrent:build', + 'connect:livereload', + 'watch' + ]); grunt.registerTask('auto-test', [ 'jasmine_node', 'watch:test' ]); diff --git a/package.json b/package.json index b8e19779..92e572d8 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "grunt-contrib-copy": "~0.5.0", "moddle": "~0.0.1", "moddle-xml": "~0.0.1", + "grunt-concurrent": "~0.4.0", "lodash": "~2.4.0" }, "dependencies": {