How to pass options to Browserify transform?
Closed this issue · 6 comments
pheuter commented
In .zuul.yml, I want to be able to pass options to a particular transform, like so:
browserify:
- transform: [ reactify --es6 ]
- transform: concatenify
I've tried using different syntax, including an -options
entry, but none seem to work.
defunctzombie commented
I don't think this is currently supported. How do you pass options to transforms on the browserify command line?
rase- commented
@defunctzombie like so:
-t [6to5ify --blacklist react]
rase- commented
I can look into it.
rase- commented
Submitted #143
Looking into browserify's _mdeps.transforms
it looks good, but I haven't tried the options in practice. Creating a test project to try it out.
rase- commented
Tried successfully with a small transform:
var through = require('through2');
module.exports = function (file, opts) {
return through(function (buf, enc, next) {
this.push(buf.toString('utf8') + '/* comment ' + opts.custom + '*/');
next();
});
};
browserify:
- transform:
name: testify
custom: this should appear
- transform: 6to5ify
vvo commented
great!