grunt-compass-compiler
v0.1.0
Published
Grunt task to compile multiple Compass projects
Downloads
11
Maintainers
Readme
grunt-compass-compiler
A Grunt plugin for compiling multiple Compass projects (ie. it compiles against many config.rb targets). This is useful for highly modular project structures such as those of Drupal and Wordpress.
Getting Started
IMPORTANT: This plugin requires at least Grunt 0.4 or higher and Compass 1.X.X or higher - it is recommended that you always run the latest versions of both.
Ensure you have Compass installed and in your PATH by checking for its version. If you get an error, install it.
$ compass --version # you should see version 1.X.X or higher
$ gem install compass # if you get an error
Now install the Grunt task:
$ npm install grunt-compass-compiler
Then add this line to your project's Gruntfile.js
:
grunt.loadNpmTasks('grunt-compass-compiler');
This allows you to use the 'compass' task to specify targets!
compass: {
modules: {
options: {
css_dir: 'css',
sass_dir: 'sass',
javascripts_dir: 'js',
output_style: (grunt.option('env') === 'prod') ? 'compressed' : 'expanded',
c: 'prod.rb' // look for something other than config.rb and use it to compile
ignore_pattern: /sass|css|js|img|images|inc|includes/, // paths you know won't contain a compass config
},
files: {
src: ['sites/all/modules/**/*']
}
}
}
The task will look for a 'prod.rb' (instead of config.rb) file in each target directory found. It will execute 'compass compile' along with any given option on each target.
$ grunt compass:modules --env=prod
Would compile each prod.rb found anywhere inside "sites/all/modules" by executing this command:
$ compass compile -c prod.rb --sass-dir=sass --javascripts-dir=js --css-dir=css --output-style=compressed
Documentation
The
compass
task is a multi task, meaning that it will implicitly iterate over all of its targets if no target is specified.Windows support is predictably absent
You must have Compass in your system PATH or this task won't work
Contributing
Feel free to fork if you see possible improvements or contact me directly if you want to contribute to this project (or just submit a pull request): [email protected]
Author
License
This project is licensed under the MIT license.