Browse Source

add 'grunt watch' target to recompile .less files (fix #40)

Manfred Kroehnert 9 years ago
parent
commit
b074d71915
2 changed files with 13 additions and 1 deletions
  1. 12 1
      Gruntfile.js
  2. 1 0
      package.json

+ 12 - 1
Gruntfile.js

@@ -16,9 +16,10 @@ module.exports = function(grunt) {
   var path = require('path');
 
   // These plugins provide necessary tasks.
+  grunt.loadNpmTasks('grunt-execute');
   grunt.loadNpmTasks('grunt-contrib-clean');
   grunt.loadNpmTasks('grunt-contrib-less');
-  grunt.loadNpmTasks('grunt-execute');
+  grunt.loadNpmTasks('grunt-contrib-watch');
   grunt.loadNpmTasks('amber-dev');
 
   // Default task.
@@ -90,6 +91,16 @@ module.exports = function(grunt) {
 
     clean: {
       test_runner: ['test_runner.js']
+    },
+
+    watch: {
+      less: {
+        files: ['resources/*.less'],
+        tasks: ['less'],
+        options: {
+          spawn: false
+        }
+      }
     }
   });
 

+ 1 - 0
package.json

@@ -28,6 +28,7 @@
     "grunt": "^0.4.5",
     "grunt-contrib-clean": "^0.6.0",
     "grunt-contrib-less": "^1.0.1",
+    "grunt-contrib-watch": "^0.6.1",
     "grunt-execute": "^0.2.1",
     "requirejs": "^2.1.15"
   },