aurelia / aurelia/cli

failure to handle the "browser" field in dependencies' package.json

Open
#581 4 comments 0 reactions 0 assignees View on GitHub
bundler enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.