Skip to content

gobblejs/gobble-postcss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Post-process CSS files with gobble and postcss

Resources

Stars

Watchers

Forks

Packages

No packages published