insert-css
insert a string of css into the <head>
example
suppose we've got some css:
and we want to bundle that css into a js file so that we can write an entirely self-contained module:
var fs = ;var insertCss = ;var css = fs;;documentbody;
optionally prepend the css to the head with the prepend
option:
;
compile with browserify using
brfs to inline the fs.readFile()
call:
$ browserify -t brfs insert.js > bundle.js
Now plop that bundle.js into a script tag and you'll have a self-contained js blob with inline css!