broccoli-postcss-sourcemaps
Postcss compiler for Broccoli with support for sourcemaps and one-to-many compilation.
Last updated 5 years ago by chriseppstein .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install broccoli-postcss-sourcemaps 
SYNC missed versions from official npm registry.

broccoli-postcss-sourcemaps

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

This is a fork of broccoli-postcss which adds support for sourcemaps and other 1-to-many css output scenarios.

Installation

npm install --save-dev broccoli-postcss-sourcemaps

Usage

var compileCSS = require('broccoli-postcss-sourcemaps');

var outputTree = compileCSS(inputTree, options);
  • inputTrees: An array of trees that specify the directories used by Broccoli. If you have a single tree, pass [tree].
  • options: Options for PostCSS. Additional options are specified below.

Options not passed to PostCSS

  • plugins An array 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.
  • resultHandler: A callback that is invoked after each file is processed by PostCSS. This can be used to process the PostCSS result messages or do other per-file operations. Note: the primary output file has not yet been written to disk when this callback is invoked. It is passed result, filter, relativePath, addOutputFile.
    • result: [Object] The PostCSS result object.
    • filter: [Object] The Broccoli Multi Filter object.
    • relativePath: [String] The relative path of the file being compiled.
    • addOutputFile: [Function] A callback that can be used to register additional output files with the Broccoli Multi Filter

Example

/* Brocfile.js */
var compileCSS = require('broccoli-postcss-sourcemaps');
var cssnext = require('cssnext');

var options = {
  plugins: [
    {
      module: cssnext,
      options: {
        browsers: ['last 2 version']
      }
    }
  ],
  map: {
    inline: false,
    annotation: false
  }
}

var outputTree = compileCSS(['styles'], options);
module.exports = outputTree;

Current Tags

  • 2.2.0-sourcemaps.1                                ...           latest (5 years ago)

2 Versions

  • 2.2.0-sourcemaps.1                                ...           5 years ago
  • 2.2.0-sourcemaps.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (5)
Dev Dependencies (6)

Copyright 2014 - 2017 © taobao.org |