Roots CSS Pipeline
Roots css pipeline is an asset pipeline for css files which optionally concatenates and/or minifies css files for production builds.
Note: This project is in early development, and versioning is a little different. Read this for more details.
Installation
-
make sure you are in your roots project directory
-
npm install css-pipeline --save
-
modify your app.coffee
file to include the extension, as such
css_pipeline = require('css-pipeline')
module.exports =
extensions: [css_pipeline(files: "assets/css/**", out: 'css/build.css', minify: true)]
Usage
As can be seen above, the plugin takes a minimatch string (or array of minimatch strings) to build it's tree of processed files. You will then have the function css
made available in all your views, when you can execute to output the tag or tags needed. If you specify an out
path, all the matched files will all be concatenated and that one file will be inserted into a view wherever the css
function is called, and if not, it will individually compile each file and output tags linking to each one.
For example, in a jade view:
!= css()
//- outputs "<link rel='stylesheet' src='css/build.css' />"
//- or if no output path, link tags for each css file matched by `files`
Options
files
String or array of strings (minimatch supported) pointing to one or more file paths which will serve as the base.
out
If provided, all input files will be concatenated to this single path. Default is false
minify
Minfifies the output. Default is false
.
opts
Options to be passed into the minifier. Only does anything useful when minify is true. Possible options can be seen here.
License & Contributing