From 4da13218b3da966dabc7abb8b7c40585180be386 Mon Sep 17 00:00:00 2001 From: Simon Elliott Date: Fri, 25 Oct 2013 18:47:14 +0100 Subject: [PATCH] compile less --- build_example.sh | 2 +- grunt-scaffold/root/.gitignore | 1 + grunt-scaffold/root/Gruntfile.coffee | 12 ++++++------ grunt-scaffold/root/app/index.js | 2 +- grunt-scaffold/root/package.json.tmpl | 3 ++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/build_example.sh b/build_example.sh index caadaca..e0e834d 100755 --- a/build_example.sh +++ b/build_example.sh @@ -6,4 +6,4 @@ cd example-widget ../node_modules/grunt-init/bin/grunt-init ../grunt-scaffold --yes npm install bower install -grunt requirejs-i18n +grunt build diff --git a/grunt-scaffold/root/.gitignore b/grunt-scaffold/root/.gitignore index 07f2661..98339f7 100644 --- a/grunt-scaffold/root/.gitignore +++ b/grunt-scaffold/root/.gitignore @@ -1,2 +1,3 @@ app/nls app/lib +app/compiled diff --git a/grunt-scaffold/root/Gruntfile.coffee b/grunt-scaffold/root/Gruntfile.coffee index ef0f895..b7170cd 100644 --- a/grunt-scaffold/root/Gruntfile.coffee +++ b/grunt-scaffold/root/Gruntfile.coffee @@ -1,12 +1,8 @@ module.exports = (grunt) -> - #grunt.loadNpmTasks 'grunt-contrib-clean' - #grunt.loadNpmTasks 'grunt-contrib-watch' - #grunt.loadNpmTasks 'grunt-contrib-connect' - #grunt.loadNpmTasks 'grunt-contrib-requirejs' + grunt.loadNpmTasks 'grunt-contrib-less' grunt.loadTasks 'tasks' - grunt.initConfig jshint: @@ -44,6 +40,10 @@ module.exports = (grunt) -> options: src: 'app/i18n.yml' dest: 'app/nls/' + less: + widget: + files: + "app/compiled/css/main.css": "app/less/main.less" grunt.registerTask 'default', ['build', 'connect', 'watch'] - grunt.registerTask 'build', ['requirejs'] + grunt.registerTask 'build', ['less:widget', 'requirejs-i18n:widget'] diff --git a/grunt-scaffold/root/app/index.js b/grunt-scaffold/root/app/index.js index d6bae6a..cb8bd16 100644 --- a/grunt-scaffold/root/app/index.js +++ b/grunt-scaffold/root/app/index.js @@ -2,7 +2,7 @@ define([ 'Ractive', 'i18n!./nls/strings', './plugin/rv!./templates/index.html', - //'less!../less/main', + 'css!./compiled/css/main', ], function(Ractive, strings, template ) { var module = { views: {} }; diff --git a/grunt-scaffold/root/package.json.tmpl b/grunt-scaffold/root/package.json.tmpl index 846021b..b08d4c5 100644 --- a/grunt-scaffold/root/package.json.tmpl +++ b/grunt-scaffold/root/package.json.tmpl @@ -2,6 +2,7 @@ "name": "{%= name %}", "version": "{%= version %}", "dependencies": { - "underscore": "~1.5.2" + "underscore": "~1.5.2", + "grunt-contrib-less": "~0.8.1" } }