defunctzombie/zuul

How to pass options to Browserify transform?

Closed this issue · 6 comments

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.

I don't think this is currently supported. How do you pass options to transforms on the browserify command line?

@defunctzombie like so:

-t [6to5ify --blacklist react]

I can look into it.

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.

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!