Skip to content
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

Is exposed name from b.require() supposed to be available inside bundle? #1137

Open
jmm opened this issue Feb 23, 2015 · 0 comments
Open

Is exposed name from b.require() supposed to be available inside bundle? #1137

jmm opened this issue Feb 23, 2015 · 0 comments

Comments

@jmm
Copy link
Collaborator

jmm commented Feb 23, 2015

The documentation for b.require() says:

Make file available from outside the bundle with require(file).

This doesn't communicate any relationship between b.require()d files and other files in the same bundle. However, people frequently use b.require() to expose a file under an alias that they then use to require the file in other files in the bundle, e.g.:

bundler.js

browserify('./entry').require('./x', {expose: "whatever"});

entry.js

require('whatever');

I believe some of browserify's tests of b.require() even rely on that.

If that behavior is intended it should be documented, and if it's not intended the documentation should note that to make it clear. I think it's a useful feature, if it doesn't interfere with any other use cases. There is currently a lot of flakiness in browserify about matching up values passed / configured via things like b.require(), require() calls in bundled files, browser field etc. though, so getting the documentation tightened up re: what should happen would be very beneficial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant