node package manager

broccoli-postcss

broccoli-postcss

Travis Build Status npm version Coverage Status bitHound Overall Score

The broccoli-postcss plugin runs your css through postcss plugins of your choosing.

Installation

npm install --save-dev broccoli-postcss

Usage

var compileCSS = require('broccoli-postcss')
var outputTree = compileCSS(tree, options)

API

broccoliPostcss(tree, [options])

options

plugins

Type: array

A list of plugin objects to be used by Postcss (a minimum of 1 plugin is required). The supported object format is module: the plugin module itself, and options: an object of supported options for the given plugin.

map

Type: object Default: { inline: false, annotation: false }

An object of options to describe how Postcss should handle source maps.

include

Type: array Default: []

Array of GlobStrings|RegExps|Functions to describe a whitelist of files to get processed by Postcss.

exclude

Type: array Default: []

Array of GlobStrings|RegExps|Functions to describe a blacklist of files to be ignored by Postcss.

Example

/* Brocfile.js */
var compileCSS = require('broccoli-postcss')
var cssnext = require('postcss-cssnext')
 
var options =  {
  plugins: [
    {
      module: cssnext,
      options: {
          browsers: ['last 2 version']
      }
    },
  ],
  map: false,
  include: ['styles/*.css'],
  exclude: ['vendor/bootstrap/**/*']
}
 
var outputTree = compileCSS('app/styles', options)
module.exports = outputTree