benbria / browserify-transform-tools

Utilities for writing browserify transforms.
MIT License
65 stars 15 forks source link

Do requireTransforms allow for relative path changes? #14

Closed joseph-norman closed 9 years ago

joseph-norman commented 9 years ago

I'm using the following to change a require in a given transform:

  var transform = transformTools.makeRequireTransform("requireTransform",
    {evaluateArguments: true},
    function(args, opts, cb) {
      if (args[0] === 'modernizr') {
        return cb(null, "require('../../../libs/modernizr/modernizr.js')");
      } else {
        return cb();
      }
  });

And yet I'm not seeing the relative file change. Is this something supported? Am I overlooking something?