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) {
108
108
109
109
// wrap the `bundle` function
110
110
var bundle = browserify . bundle ;
111
- browserify . bundle = function ( opts , cb ) {
111
+ browserify . bundle = function ( cb ) {
112
112
// reset the `tokensByFile` cache
113
113
tokensByFile = { } ;
114
114
115
115
// 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 ( ) {
120
117
// Combine the collected sources into a single CSS file
121
118
var css = Object . keys ( sourceByFile ) . map ( function ( file ) {
122
119
return sourceByFile [ file ] ;
123
120
} ) . join ( '\n' ) ;
121
+ var args = arguments ;
124
122
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 ) ;
127
125
} ) ;
128
126
} ) ;
129
127
You can’t perform that action at this time.
0 commit comments