From f9d308f9236dfebfcb4a8497f58987ce11d7b336 Mon Sep 17 00:00:00 2001 From: Param Aggarwal Date: Fri, 28 Aug 2015 22:15:57 +0530 Subject: [PATCH] Watch for changes and run tests during development using `grunt watch`. --- Gruntfile.js | 7 ++++++- package.json | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 1986e731..14478afd 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -149,7 +149,12 @@ module.exports = function(grunt) { javaPackage: { command: 'jar cf <%= config.distFolder %>/<%= config.libName %>.jar <%= config.javaSource %>' } - } + }, + + watch: { + files: ['src/Layout.js'], + tasks: ['ci'], + }, }); // Compiles and runs the Java tests diff --git a/package.json b/package.json index de049b94..c558a813 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "Reimplementation of CSS layout using pure JavaScript", "main": "dist/css-layout.js", "scripts": { + "watch": "grunt watch", "test": "grunt ci", "postversion": "git push --tags upstream HEAD:master" }, @@ -24,6 +25,7 @@ "grunt-contrib-concat": "^0.5.1", "grunt-contrib-copy": "^0.8.0", "grunt-contrib-uglify": "^0.9.1", + "grunt-contrib-watch": "^0.6.1", "grunt-eslint": "^17.1.0", "grunt-execute": "^0.2.2", "grunt-include-replace": "^3.1.0",