Browse Source

Merge pull request #62 from mkroehnert/grunt-lessc

add compilation of helios.less to Gruntfile + grunt watch task
Herbert Vojčík 9 years ago
parent
commit
553299c43d
2 changed files with 25 additions and 4 deletions
  1. 22 3
      Gruntfile.js
  2. 3 1
      package.json

+ 22 - 3
Gruntfile.js

@@ -16,12 +16,14 @@ module.exports = function(grunt) {
   var path = require('path');
 
   // These plugins provide necessary tasks.
-  grunt.loadNpmTasks('grunt-contrib-clean');
   grunt.loadNpmTasks('grunt-execute');
+  grunt.loadNpmTasks('grunt-contrib-clean');
+  grunt.loadNpmTasks('grunt-contrib-less');
+  grunt.loadNpmTasks('grunt-contrib-watch');
   grunt.loadNpmTasks('amber-dev');
 
   // Default task.
-  grunt.registerTask('default', ['amberc:all']);
+  grunt.registerTask('default', ['less', 'amberc:all']);
   grunt.registerTask('test', ['amberc:test_runner', 'execute:test_runner', 'clean:test_runner']);
   grunt.registerTask('devel', ['amdconfig:helios']);
 
@@ -35,11 +37,18 @@ module.exports = function(grunt) {
       '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
       ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
     // task configuration
+    less: {
+      development: {
+        files: {
+          'resources/helios.css': 'resources/helios.less'
+        }
+      }
+    },
+
     amberc: {
       options: {
         amber_dir: findAmberPath(['../..', 'bower_components/amber']),
         library_dirs: ['src'],
-        closure_jar: ''
       },
       all: {
         output_dir : 'src',
@@ -82,6 +91,16 @@ module.exports = function(grunt) {
 
     clean: {
       test_runner: ['test_runner.js']
+    },
+
+    watch: {
+      less: {
+        files: ['resources/*.less'],
+        tasks: ['less'],
+        options: {
+          spawn: false
+        }
+      }
     }
   });
 

+ 3 - 1
package.json

@@ -25,8 +25,10 @@
   },
   "devDependencies": {
     "amber-dev": "^0.4.0",
-    "grunt": "^0.4.0",
+    "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"
   },