failure to handle the "browser" field in dependencies' package.json
- Dominant language
- JavaScript
- Stars
- 402
- Forks
- 134
- PR merge metrics
- No merged PRs in 30d
Description
**I'm submitting a bug report**
* **Library Version:**
0.27.0
**Please tell us about your environment:**
* **Operating System:**
Windows 8.1
* **Node Version:**
6.10.0
* **NPM Version:**
3.10.10
**Current behavior:**
Several libs show a "browser" field in their package.json, which can be of several forms :
1) alternative "main", e.g. "index-browser"
2) arguments, e.g. leveldown = false
aurelia-cli ignores this information, thus requiring the same dependencies as the node version... which inevitably fails.
As a result, users have to edit aurelia.json to add a "main" section, or worse edit the library to hard-code any arguments that change its behaviour for the browser.
**Expected/desired behavior:**
The "browser" section of package.json should be taken into account when loading and tracing a dependency module.
* **What is the motivation / use case for changing the behavior?**
Make the inclusion of certain libraries (e.g. pouchdb-adapter-memory) seamless, save the developers' time, and more importantly bring peace and happiness among all nations and people.
Contributor guide
Assessment
This issue has not been assessed yet.