Commit 83543b62 authored by Thomas Park's avatar Thomas Park
Browse files

build with less instead of recess

parent 303ba425
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-watch');
......@@ -32,10 +32,9 @@ module.exports = function (grunt) {
dest: ''
}
},
recess: {
less: {
dist: {
options: {
compile: true,
compress: false
},
files: {}
......@@ -50,32 +49,32 @@ module.exports = function (grunt) {
var concatSrc;
var concatDest;
var recessDest;
var recessSrc;
var lessDest;
var lessSrc;
var files = {};
var dist = {};
concatSrc = 'global/build.less';
concatDest = theme + '/build.less';
recessDest = '<%=builddir%>/' + theme + '/bootstrap.css';
recessSrc = [ theme + '/' + 'build.less' ];
lessDest = '<%=builddir%>/' + theme + '/bootstrap.css';
lessSrc = [ theme + '/' + 'build.less' ];
dist = {src: concatSrc, dest: concatDest};
grunt.config('concat.dist', dist);
files = {}; files[recessDest] = recessSrc;
grunt.config('recess.dist.files', files);
grunt.config('recess.dist.options.compress', false);
files = {}; files[lessDest] = lessSrc;
grunt.config('less.dist.files', files);
grunt.config('less.dist.options.compress', false);
grunt.task.run(['concat', 'recess:dist', 'clean:build',
compress ? 'compress:'+recessDest+':'+'<%=builddir%>/' + theme + '/bootstrap.min.css':'none']);
grunt.task.run(['concat', 'less:dist', 'clean:build',
compress ? 'compress:'+lessDest+':'+'<%=builddir%>/' + theme + '/bootstrap.min.css':'none']);
});
grunt.registerTask('compress', 'compress a generic css', function(fileSrc, fileDst) {
var files = {}; files[fileDst] = fileSrc;
grunt.log.writeln('compressing file ' + fileSrc);
grunt.config('recess.dist.files', files);
grunt.config('recess.dist.options.compress', true);
grunt.task.run(['recess:dist']);
grunt.config('less.dist.files', files);
grunt.config('less.dist.options.compress', true);
grunt.task.run(['less:dist']);
});
grunt.registerMultiTask('swatch', 'build a theme', function() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment