From f08822ab374eae0115dc3f02571d2e497620cae2 Mon Sep 17 00:00:00 2001 From: Tarek Sherif Date: Thu, 2 Jul 2015 01:24:06 -0400 Subject: [PATCH] Watch task --- Gruntfile.js | 10 ++++++++++ package.json | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 55137a0d..82cbc24a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -50,6 +50,15 @@ module.exports = function (grunt) { src: 'api/latest/<%= PROJECT_NAME %>.js', dest: '<%= build_dir %>/<%= PROJECT_NAME %>-<%= ENGINE_VERSION %>.js' } + }, + watch: { + scripts: { + files: ["<%= concat.engine.src %>", "Gruntfile.js"], + tasks: ["snapshot"], + options: { + spawn: false, + }, + }, } }); @@ -57,6 +66,7 @@ module.exports = function (grunt) { grunt.loadNpmTasks("grunt-contrib-concat"); grunt.loadNpmTasks("grunt-contrib-clean"); grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-contrib-watch'); // Builds snapshot libs within api/latest // Run this when testing examples locally against your changes before committing them diff --git a/package.json b/package.json index 8b0277d5..64757123 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "grunt-contrib-clean": "~0.6.0", "grunt-contrib-copy": "~0.8.0", "grunt-contrib-jasmine": "~0.8.2", - "grunt-contrib-qunit": "~0.5.2" + "grunt-contrib-qunit": "~0.5.2", + "grunt-contrib-watch": "~0.6.1" }, "engines": { "node": ">=0.10.17",