Created
November 15, 2013 00:41
-
-
Save kamilogorek/7477175 to your computer and use it in GitHub Desktop.
Task for building LESS files using LESSPHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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