Skip to content

Instantly share code, notes, and snippets.

@kamilogorek
Created November 15, 2013 00:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamilogorek/7477175 to your computer and use it in GitHub Desktop.
Save kamilogorek/7477175 to your computer and use it in GitHub Desktop.
Task for building LESS files using LESSPHP
module.exports = function(grunt) {
'use strict';
var execSync = require('exec-sync');
grunt.initConfig({
lessphp: {
files: {
'path/to/source.less': 'path/to/compiled.css',
}
}
}
grunt.registerTask('lessphp', function () {
var source;
var destination;
console.log('Building less...');
for (source in grunt.config.data.lessphp.files) {
destination = grunt.config.data.lessphp.files[source];
execSync('/path/to/bin/compile-less ' + source + ' ' + destination);
console.log('Compiled ' + source + ' into ' + destination);
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment