grunt-r3m
This is a very tiny set of tasks for grunt. It contains:
preprocess: a tiny utility to concat files, and execute string replacements during concatenation. cLess: a tiny utility that uses less to parse less files, and concatenate them along with regular css files appart from concat files this utility also replace the relative urls of the assets referenced by the less files while moving them to a folder called assets/ which is relative to the output file
Getting Started
Install this grunt plugin next to your project's Gruntfile.js gruntfile with: npm install grunt-r3m --save-dev
Then add this line to your project's grunt.js
gruntfile:
grunt;
Documentation
These tasks are multi task, meaning that grunt will automatically iterate over all cLess
and
preprocess
targets if a target is not specified.
cLess task
Target Properties
- src(required): The LESS file(s) to be compiled. Can be either a string or an array of strings. If more than one LESS file is provided, each LESS file will be compiled individually and then concatenated together.
- dest(required): The path where the output from the LESS compilation should be placed. Must be a string as there can be only one destination.
- options(optional): An object of LESS options. As of right now, the only options supported are
compress
andyuicompress
.
Example
// project configurationgrunt;
preprocess task
Target Properties
- src(required): The file to be processed.
- dest(required): The path where the output should be placed.
- options(required): some configuration options to use like removeHTMLComments, enable include statements, and replacements to be processed. Take a look at the example below
Example
// project configurationgrunt;
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.
Release History
- 02/18/2013 - 0.1.8: Added some documentation.
- 04/04/2012 - 0.1.0: Initial release.
License
Copyright (c) 2012 Roy Riojas This is based on the original grunt-less task Licensed under the MIT license.