css-extract

Extract CSS from a browserify bundle

Github stars Tracking Chart

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

Main metrics

Overview
Name With Owneralexmingoia/jsx-transform
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 2)
Platform
License:
所有者活动
Created At2014-06-27 09:49:20
Pushed At2020-02-27 17:18:19
Last Commit At2020-02-27 12:18:18
Release Count30
Last Release Namev2.3.0 (Posted on 2016-01-26 08:29:57)
First Release Name0.1.0 (Posted on 2014-06-27 02:57:04)
用户参与
Stargazers Count294
Watchers Count9
Fork Count28
Commits Count121
Has Issues Enabled
Issues Count23
Issue Open Count9
Pull Requests Count19
Pull Requests Open Count0
Pull Requests Close Count6
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private