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

alt-browser fallback to "browser" for browserification of dependencies? #62

Closed
mvayngrib opened this issue Mar 30, 2015 · 4 comments
Closed

Comments

@mvayngrib
Copy link
Contributor

this is a question. If A depends on B, and their package.json's look like:

A:

    {
      ...
      "chromeapp": {
        "dgram": "chrome-dgram"
      },
      "dependencies": {
        "B": "^1.0.0"
      }
      ...
    }

B:

    {
      ...
      "browser": {
        "url": "./browser-url.js"
      }
      ...
    }

when you issue:

    browserify --browser chromeapp A/main.js

should browserify fall back to the "browser" field when it browserifies B and needs to resolve "url" but doesn't find a "chromeapp" field? It seems like in most cases this would be desirable. What do you think?

@defunctzombie
Copy link
Collaborator

Good question. What is the current behavior? No fallback? Silent failure? Loud failure?

@mvayngrib
Copy link
Contributor Author

the current behavior is that it'll look for "chromeapp" in the nested dependency (where only "browser" exists), not find it, and resolve to whatever file/module gets used in the regular node.js environment. So basically it ends up handing you non-browserified deps

@defunctzombie
Copy link
Collaborator

fixed in v1.9.0

Thanks!

@mvayngrib
Copy link
Contributor Author

cool, thx for merging

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

No branches or pull requests

2 participants