wmr icon indicating copy to clipboard operation
wmr copied to clipboard

Resolve nested "browser" field

Open marvinhagemeister opened this issue 4 years ago • 0 comments

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"
},

marvinhagemeister avatar Oct 03 '20 16:10 marvinhagemeister