Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1.15 KB

README.md

File metadata and controls

46 lines (34 loc) · 1.15 KB

gobble-postcss

Post-process CSS files with gobble and postcss.

Installation

First, you need to have gobble installed - see the gobble readme for details. Then,

npm i -D gobble-postcss

Usage

var gobble = require( 'gobble' );
module.exports = gobble( 'src/styles' ).transform( 'postcss', {
  plugins: [
    require( 'postcss-import' ),
    require( 'autoprefixer' )({ browsers: [ 'last 2 versions' ] }),
    require( 'cssnano' )
  ],

  // if `src` is omitted, all CSS files will be processed. If you're
  // using `postcss-import`, that's probably not what you want. It
  // can be a glob pattern
  src: 'main.css',

  // `dest` can be a string if `src` is supplied and is *not* a glob
  // pattern. Otherwise it must be a function. If omitted, dest name
  // will be same is src name
  dest: function ( src ) {
    // e.g. main.css -> main.min.css
	return src.replace( '.css', '.min.css' );
  },

  // sourcemap options. `true` (default) means the sourcemap will
  // be inlined, `false` means no sourcemap
  map: false
});

License

MIT. Copyright 2015 Rich Harris