Compile LESS files to CSS (part of the grunt-contrib collection). Submitted by Tyler Kellen.
Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-contrib-less
Then add this line to your project's grunt.js
gruntfile:
grunt.loadNpmTasks('grunt-contrib-less');
Inside your grunt.js
file add a section named less
. This section specifies the files to compile and the options passed to LESS.
This defines what files this task will process and should contain key:value pairs.
The key (destination) should be an unique filepath (supports grunt.template) and the value (source) should be a filepath or an array of filepaths (supports minimatch).
Note: When the value contains an array of multiple filepaths, the contents are concatenated in the order passed.
This controls how this task (and its helpers) operate and should contain key:value pairs, see options below.
This specifies directories to scan for @import directives when parsing.
less: {
compile: {
options: {
paths: ["assets/css"]
},
files: {
"path/to/result.css": "path/to/source.less"
}
}
}