File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -108,22 +108,20 @@ module.exports = function (browserify, options) {
108108
109109 // wrap the `bundle` function
110110 var bundle = browserify . bundle ;
111- browserify . bundle = function ( opts , cb ) {
111+ browserify . bundle = function ( cb ) {
112112 // reset the `tokensByFile` cache
113113 tokensByFile = { } ;
114114
115115 // call the original
116- var stream = bundle . apply ( browserify , arguments ) ;
117-
118- // close the css stream
119- stream . on ( 'end' , function ( ) {
116+ var stream = bundle . call ( browserify , function ( ) {
120117 // Combine the collected sources into a single CSS file
121118 var css = Object . keys ( sourceByFile ) . map ( function ( file ) {
122119 return sourceByFile [ file ] ;
123120 } ) . join ( '\n' ) ;
121+ var args = arguments ;
124122
125- fs . writeFile ( cssOutFilename , css , function ( err ) {
126- if ( err ) console . error ( err ) ;
123+ fs . writeFile ( cssOutFilename , css , function ( ) {
124+ if ( typeof cb === 'function' ) cb . apply ( null , args ) ;
127125 } ) ;
128126 } ) ;
129127
You can’t perform that action at this time.
0 commit comments