ForbesLindesay / browserify-middleware

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

Passing options to transforms #51

Closed refractalize closed 10 years ago

refractalize commented 10 years ago

Some transforms allow options to be passed to them, and this is supported in browserify command line and API, but not (yet anyway) in browserify-middlware.

Here's the line that's interesting: https://github.com/ForbesLindesay/browserify-middleware/blob/master/lib/compile.js#L96

Options can be a hash passed as the first argument to transform([options], transform). Question is, how should they be specified in the browserify-middleware API?

The obvious thing to do is supply an array, with the options and string/function, or just a string/function:

options.transforms = [[{relativeUrls: true}, 'lessify'], 'html2js']

Unless you have a better idea?

Happy to make a pull request, just wanted to check with you before I went ahead.

refractalize commented 10 years ago

See #52