From 7b44fd47a72ab0c9a4c586193757a4f195bb5fe4 Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Mon, 22 Dec 2014 15:28:23 +0100 Subject: [enh] improve grunt-file for oscar_template --- searx/static/oscar/gruntfile.js | 43 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) (limited to 'searx/static/oscar/gruntfile.js') diff --git a/searx/static/oscar/gruntfile.js b/searx/static/oscar/gruntfile.js index 79da491c4..c591e8505 100644 --- a/searx/static/oscar/gruntfile.js +++ b/searx/static/oscar/gruntfile.js @@ -33,9 +33,43 @@ module.exports = function(grunt) { } } }, + less: { + development: { + options: { + paths: ["less/oscar"] + //banner: '/*! less/oscar/oscar.css | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n' + }, + files: {"css/oscar.css": "less/oscar/oscar.less"} + }, + production: { + options: { + paths: ["less/oscar"], + //banner: '/*! less/oscar/oscar.css | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n', + cleancss: true + }, + files: {"css/oscar.min.css": "less/oscar/oscar.less"} + }, + bootstrap: { + options: { + paths: ["less/bootstrap"], + cleancss: true + }, + files: {"css/bootstrap.min.css": "less/bootstrap/bootstrap.less"} + }, + }, watch: { - files: ['<%= jshint.files %>'], - tasks: ['jshint'] + scripts: { + files: ['<%= jshint.files %>'], + tasks: ['jshint', 'concat', 'uglify'] + }, + oscar_styles: { + files: ['less/oscar/**/*.less'], + tasks: ['less:development', 'less:production'] + }, + bootstrap_styles: { + files: ['less/bootstrap/**/*.less'], + tasks: ['less:bootstrap'] + } } }); @@ -43,9 +77,12 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-less'); grunt.registerTask('test', ['jshint']); - grunt.registerTask('default', ['jshint', 'concat', 'uglify']); + grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'less']); + + grunt.registerTask('styles', ['less']); }; -- cgit v1.2.3