ForbesLindesay / browserify-middleware

express middleware for browserify, done right
http://browserify.org
MIT License
381 stars 66 forks source link

hooks should be async #59

Closed killroy42 closed 10 years ago

killroy42 commented 10 years ago

Hooks really should be asynchronous. for example to use closure compiler in a postcompile hook. The additional code shouldn't be complex. I got it to work with something like:

if (!options.postcompile) options.postcompile = function(src, cb) { cb(null, src); }; options.postcompile(src, function(err, src) {

I might do a pull request later, but I figured all hooks should be converted then.

Cheers for this great tool!

killroy42 commented 10 years ago

I created a pull request: https://github.com/ForbesLindesay/browserify-middleware/pull/60