- __Bug:__ Don't break when an upstream transform erroneously produces a Buffer while claiming it to be `encoding: "utf8"`, by ignoring the `encoding` parameter entirely.
- __Bug:__ Fall back to working directory for relative path calculation, when no explicit entry path is specified.
// FIXME: When there's >1 icssify instance set up on the Browserify instance (can this happen when a module specifies its own dependency on icssify?), either throw an error (if incompatible?) or merge the two somehow, so that there's only one resulting .css file
functionsetupPipeline(browserify,options){
functionsetupPipeline(browserify,options){
/* Not shown here: the default 'deps' phase stream will process all the CSS files through our custom transform (defined elsewhere). That transform handles the discovery of CSS dependencies, by pre-processing the CSS files (normalizing 'composes' statements etc. into :import/:export statements), and then extracting all the imports from them, emitting them to Browserify as additional dependencies to fetch. */
/* Not shown here: the default 'deps' phase stream will process all the CSS files through our custom transform (defined elsewhere). That transform handles the discovery of CSS dependencies, by pre-processing the CSS files (normalizing 'composes' statements etc. into :import/:export statements), and then extracting all the imports from them, emitting them to Browserify as additional dependencies to fetch. */
// ... or, if no entry file is specified, go off the current working directory
:process.cwd()
returnstream((item)=>{
returnstream((item)=>{
// And the same for the loader shim path. All this relative-path stuff is to prevent absolute filesystem URLs from leaking into the output, as those might contain sensitive information.
// And the same for the loader shim path. All this relative-path stuff is to prevent absolute filesystem URLs from leaking into the output, as those might contain sensitive information.
@ -17,11 +17,12 @@ module.exports = function createTransform(file, options) {
letbuffer=newbl.BufferList();
letbuffer=newbl.BufferList();
functionchunkHandler(chunk,encoding,callback){
functionchunkHandler(chunk,encoding,callback){
if(encoding==="buffer"){
// NOTE: We check the `chunk` here, not the `encoding`, because in at least one instance a Buffer was passed in claiming to be a "utf8" string according to the `encoding` argument