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

Add "browser" alternative path to package.json #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AirAKose
Copy link

Recently ran into an issue with the npm version of requirejs where I was accidentally pushing the compiled version (r.js) to browser clients because of a generic script redirector checking node_module packages for their main paths.

This redirector checks for "browser" first and then falls back to "main" (or defaults to either "index.js" or "{name}.js" if that's missing).

I'm just recently trying to get back into the webdev game, so please let me know if there's a history here or any reason that the "browser" field hasn't seen wider adoption! It seems like a great generic solution to packaging and delivery problems.

Recently ran into an issue with the npm version of requirejs where I was accidentally pushing the compiled version (r.js) to browser clients because of a generic script redirector checking node_module packages for their main paths.

This redirector checks for "browser" first and then falls back to "main" (or defaults to either "index.js" or "{name}.js" if that's missing).

I'm just recently trying to get back into the webdev game, so please let me know if there's a history here or any reason that the "browser" field hasn't seen wider adoption! It seems like a great generic solution to packaging and delivery problems.
@jsf-clabot
Copy link

jsf-clabot commented Jul 21, 2019

CLA assistant check
All committers have signed the CLA.

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

Successfully merging this pull request may close these issues.

2 participants