-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
module.require isn't present #475
Comments
I'm not convinced that this feature is worth supporting since it would only enable hacky overriding that probably shouldn't be done in the first place at the expense of extra bytes in every browserify bundle. |
Well, three counter-arguments:
Okay, maybe 1. isn't a great argument as the readme already states that browserify provides a node-style require function, and not "node's module system for the browser". As for 2., I already submitted a PR to browser-pack, which should implement it. And it's just an additional Finally, the module I'm trying to compile is iriscouch/cqs. It uses defaultable as a way to provide default options. The actual functionality isn't even a hack, as it uses a documented feature of node's module system and uses the overwritten function for module-wide default propagation. |
@substack, would it be possible for this to be optional or even un-documented? We might argue about what constitutes "hacky overriding." What I know is that we are using @fb55's code in production and it works well. I agree with your point about spending bytes in every bundle; but I also agree with Felix's point that supporting a documented (stability = 5, locked) feature would be nice. We will be okay either way, just asking you to reconsider. Thanks. |
Localization library https://github.com/l20n/l20n.js by Mozilla also depends on module.require. |
I'd like to see the Node.js platform supported in Browserify. Getting files relative to modules is important. 😟 Also, in this particularly awful case, we're using a Browserify bundle inside a require.js webapp; require.js gracelessly stomps the Also missing: |
I'm confused, since valid use of nodejs PUBLIC API is considered hacky approach ?! |
This is still an issue. browserify/browser-pack#19 |
In node.js,
module.require
is the basis for therequire
function. Browserify instead directly hands therequire
function over, without exposing any functionality asmodule.require
.I'm trying to browserify a module that uses defaultable, which heavily depends on the behavior of node.
It would be awesome if
module.require
could be at least a reference to therequire
function.The text was updated successfully, but these errors were encountered: