benbria / browserify-transform-tools

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

feat(requireTransform): accept aliases for require #20

Closed cape-dev closed 8 years ago

cape-dev commented 8 years ago

The makeRequireTransform function now accepts an optional attribute "requireOptions" which is an object with an optional attribute "aliases" which can be a string or an array of strings. These strings are also! taken for the require transformation alongside "require".

The implemented functionality is also tested.

I also have an idea on how to modify aliasify elegantly without any breaking changes on the api. I will submit the other PR tomorrow.

cape-dev commented 8 years ago

I have found an error. The problem is that I have to know in the aliasify code what node.callee.name was... I have to tweak the transform tools a bit.