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

Resolve nested "browser" field #135

Open
marvinhagemeister opened this issue Oct 3, 2020 · 0 comments · May be fixed by #874
Open

Resolve nested "browser" field #135

marvinhagemeister opened this issue Oct 3, 2020 · 0 comments · May be fixed by #874
Labels
compat CJS/UMD/etc

Comments

@marvinhagemeister
Copy link
Member

marvinhagemeister commented Oct 3, 2020

Follow-up to #127.

Some packages use the browser field to rewrite import paths. This is usually done to swap out node-specific code with browser-based code. There is no resolution going on, it's straight up string replacement.

{
  "name": "axios",
  "browser": {
    "./adapters/http": "./adapters/xhr"
  }
}

EDIT: uuid is another package that needs this:

"browser": {
  "./lib/rng.js": "./lib/rng-browser.js",
  "./lib/sha1.js": "./lib/sha1-browser.js",
  "./lib/md5.js": "./lib/md5-browser.js"
},
@developit developit added the compat CJS/UMD/etc label Dec 5, 2020
@marvinhagemeister marvinhagemeister linked a pull request Sep 19, 2021 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compat CJS/UMD/etc
2 participants