ForbesLindesay / browserify-middleware

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

Support per-module options #9

Closed KylePDavis closed 10 years ago

KylePDavis commented 11 years ago

The docs show bundling multiple modules like this:

app.get('/js/bundle.js', browserify(['hyperquest', 'concat-stream']));

The trouble is that I need to send per-module options so that I can give a target for remapped modules.

// we could support targets, like this:
app.get('/js/bundle.js', browserify([
  {'hyperquest':'hyperquest-browserify'},
  'concat-stream'
]));
// or, maybe any arbitrary options with something like this:
app.get('/js/bundle.js', browserify([
  {module:'hyperquest-browserify', options:{target:'hyperquest'}},
  'concat-stream'
]));

Thoughts?

ForbesLindesay commented 11 years ago

As I understand it, that's a browserify 1.0.0 feature that no longer exists? If you submit a request to get functionality along these lines supported in browserify and it gets accepted there, I'll add support for it here.

KylePDavis commented 11 years ago

The part that I need, the expose option, is still supported according to the docs: https://github.com/substack/node-browserify#brequirefile-opts