-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
supporting require
aliases
#13
Comments
You're looking to, for example, transform:
into
? Could you not just pass in an |
i would prefer to support multiple in one go, so that you can use the same transform for every require alias. it might be far-fetched and possibly not a common enough case to warrant inclusion, which is why i asked. |
to answer your question, though, yes i would like to, for example, have this work: const thing = require('thing')
const otherThing = proxyquire('other-thing') (transform happens) const thing = require('transformed-thing')
const otherThing = proxyquire('transformed-other-thing') |
So what breaking changes were you thinking about, then? |
sooo.. i was actually asking about this so that i could PR pkgify to support it. in the end, i just went off and made my own that supported it rather than complicate other peoples' modules. |
hey, there!
i was wondering if there was any plan to support specifying aliases for
require
in themakeRequireTransform
method. i ask because of things like proxyquireify and others that do "hygienic"require
monkey-patching by providing an alias, but still need to be potentially transformed.i started poking at PRing the change for discussion, but encountered a brick wall in the form of (what seems like) necessarily breaking the current API. ideally, in my estimation, the
require
"word" would be somehow linked to each "argument" in the transform callback. because of this, i decided to instead ask if it was even something considered worth supporting, and if so if there was any preference about how to support it. if desired, i am more than willing to do the work to support it.thoughts?
thanks for your time!
The text was updated successfully, but these errors were encountered: