Closed refractalize closed 9 years ago
You can already do this fairly easily by just having:
var transform = require('transform');
options.transform = [[function (file) {
return transform(file, {option1: true, ...});
}], "other-transform"]
It might be worth considering dedicated support though, I'm not sure.
Good point, I didn't know you could do that so easily. But maybe that's the point, perhaps dedicated and documented support would be more obvious?
Any further comment on this? I understand you can do it as above, but having explicit (and documented) support would make it easier for others - as does the browserify API itself. What do you think?
Hi. FWIW, I've successfully managed to do this to pass options to a transform:
var browserify = require('browserify-middleware');
browserify.settings({
transform: [function(file) {
return require('jstify')(file, { engine: 'lodash' });
}]
});
app.use('/app.js', browserify('./client/app.js'));
If you don't think the change to the code is necessary, I can try to submit a hint in the docs, since I think is non-obvious as of right now.
Thank you for the project. Is been quite helpful.
Thank you!
Some transforms allow options to be passed to them, and this is supported in browserify command line and API, and now in browserify-middlware.
See readme for docs.