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

Controlling exposure of bundled modules #1039

Open
jmm opened this issue Dec 23, 2014 · 2 comments
Open

Controlling exposure of bundled modules #1039

jmm opened this issue Dec 23, 2014 · 2 comments

Comments

@jmm
Copy link
Collaborator

jmm commented Dec 23, 2014

I'm trying to make sense of how to control exposure of modules in a bundle and finding the documentation and behavior difficult to follow.

Given browserify 7.0.3 or 8.0.3 and this directory structure:

- somedir
    bundle.js
    - src
        a.js
        b.js
        c.js

#1)

Is this situation supposed to break the bundle? (does for me):

// src/a.js
require('./b');
// bundle.js
browserify('./src/a')
  .require('./src/b')

Result (when bundle loaded in browser):

Uncaught Error: Cannot find module './b'

#2)

Is this situation supposed to happen?:

// src/b.js
module.exports = "This is b.js";
browserify('./src/a')
  .require('./src/c')
<script src="bundle.js"></script>

<script>
// Logs "This is b.js"
console.log(require(2));
</script>
@jmm
Copy link
Collaborator Author

jmm commented Jan 8, 2015

I've uncovered the source of problem # 1. Details to follow.

@jmm
Copy link
Collaborator Author

jmm commented May 15, 2015

In case it's not clear, the details to follow were in #1059.

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

No branches or pull requests

1 participant