ForbesLindesay / browserify-middleware

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

add in plugin support #66

Closed deanmao closed 9 years ago

deanmao commented 9 years ago

It's nice that browserify-middleware supports transform options and everything, but sometimes you need something more extreme, like plugin support. This tiny fix allows one to pass in an array of plugins to the initial set of options so that they can manipulate the actual browserify object.

Browserify offers an official plugin api, but there is no way to access the browserify instance from the middleware as the compile step hides the instance variable in a closure. Plugins should only be applied after the options for browserify have been processed.

cjntaylor commented 9 years ago

Apart from the semi-sloppiness of this request, is there any reason it isn't merged? I'm considering using tsify in an upcoming project and I'd need plugin support for that to work. What is holding up this request?

ForbesLindesay commented 9 years ago

@cjntaylor my time to review and merge pull requests is what's holding up this project in general.

This feature specifically could do with an update in lib/settings.js to "arrayify" the option so that people don't need to wrap their plugin in an array if they are only adding one plugin. It could also probably do with a normalisation step that allows people to add plugins directly without adding the options to the object.

I'll merge this as is. Could one of either @cjntaylor or @deanmao submit a pull request for the docs changes and/or the additions to lib/settings.js?

Also, open invitation: would either of you like to be added as collaborators so you can merge other people's pull requests that I'm failing to find the time to merge?