Skip to content

Commit

Permalink
build with less instead of recess
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaspark committed Feb 3, 2014
1 parent 303ba42 commit 83543b6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
29 changes: 14 additions & 15 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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');
Expand Down Expand Up @@ -32,10 +32,9 @@ module.exports = function (grunt) {
dest: ''
}
},
recess: {
less: {
dist: {
options: {
compile: true,
compress: false
},
files: {}
Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-recess": "~0.3.1",
"grunt-contrib-less": "~0.9.0",
"grunt-contrib-concat": "~0.1.3",
"grunt-contrib-clean": "~0.4.0",
"grunt-contrib-watch": "~0.5.1",
Expand Down

0 comments on commit 83543b6

Please sign in to comment.