This package has been deprecated

Author message:

superseded by `css-extract`

bundle-cssify

2.0.2 • Public • Published

bundle-cssify

stability NPM version Downloads js-standard-style

superseded by css-extract

browserify transform to extract css for insert-css into external css files

what?

given a file like

// entry.js
var insertCss = require('insert-css')
insertCss('h1 {\n  text-align: center;\n}')
console.log("rainbows and sunshine")

transform into

// bundle.js
console.log("rainbows and sunshine")

and

/* css/86bffed652227c2fc7321a8a.css */
h1 {
  text-align: center;
}

where each extracted css file will be named by the hash of its content.

install

with npm:

npm install --save bundle-cssify

usage

cli

as a normal browserify transform:

browserify entry.js -t [ bundle-cssify -d ./css ] > bundle.js

replace -t with -g to run as a global transform (where "the transform will operate on ALL files, despite whether they exist up a level in a node_modules/ directory")

package.json

as a normal browserify transform:

{
  "scripts": {
    "build": "browserify entry.js > bundle.js"
  },
  "browserify": {
    "transform": [
      ["bundle-cssify", { "directory": "./css" } ]
    ]
  }
}

Package Sidebar

Install

npm i bundle-cssify

Weekly Downloads

1

Version

2.0.2

License

ISC

Last publish

Collaborators

  • ahdinosaur