css-extract

2.0.0 • Public • Published

css-extract stability

npm version build status test coverage downloads js-standard-style

Looks up require('insert-css') calls to extract CSS from a browserify bundle to a file. Useful with sheetify or any other package / transform that uses insert-css.

Command line

$ browserify -t sheetify/transform -p [ css-extract -o bundle.css ] index.js \
  -o bundle.js

JS api

const browserify = require('browserify')
 
browserify()
  .transform('sheetify/transform')
  .plugin('css-extract', { out: 'bundle.css' })
  .bundle()
const browserify = require('browserify')
 
browserify()
  .transform('sheetify/transform')
  .plugin('css-extract', { out: createWriteStream })
  .bundle()
 
function createWriteStream () {
  return process.stdout
}

Options

  • -o / --out: specify an outfile, defaults to bundle.css. Can also be a function that returns a writable stream from the JavaScript API.

Installation

$ npm install css-extract

See Also

License

MIT

/css-extract/

    Package Sidebar

    Install

    npm i css-extract

    Weekly Downloads

    163

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    6.93 kB

    Total Files

    5

    Last publish

    Collaborators

    • ahdinosaur
    • bret
    • goto-bus-stop
    • hughsk
    • jongacnik
    • yoshuawuyts
    • zhouhancheng