brstar
Browserify transform to preprocess static input brfs-style with your own modules.
For example, take this browserifiable module:
var preprocess =var insertCSS =var fs =var styles =if processbrowserelseconsole
And your CSS preprocessing step:
var autoprefixer = 'last 2 versions'module {return autoprefixercss}
You can bundle it up, and calculate the preprocessing step during the build, and keep it out of your client-side code!
browserify ./index.js -t brfs -t brstar
The benefit here is that it makes it easy to write transform steps such as this while keeping your code node-friendly: you can run the above bundle in node and get the same output.
Usage
To use brstar
as a browserify transform:
$ browserify -t brstar ./index.js
To enable inlining for a module, simply specify it in your package.json
file
under the brstar
array:
Gotchas
Currently no explicit support for source maps, and likely to modify the formatting of transformed modules. Pull requests are welcome to fix these issues :)
License
MIT. See LICENSE.md for details.