wmr
wmr copied to clipboard
Resolve nested "browser" field
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"
},