jspm / jspm-cli

ES Module Package Manager
https://jspm.org
Apache License 2.0
3.77k stars 272 forks source link

Feature Request: Respect package.json alias section when resolving dependencies #2568

Open schlichtanders opened 7 months ago

schlichtanders commented 7 months ago

As discussed in https://github.com/jspm/jspm-cli/issues/2564 current jspm is not able to treat alias definitions correctly.

It would be best, if jspm simply respects the alias definition from package.json so that the npm dependencies and the jspm dependencies match each other.

Importantly, alias my be such that a package on the one hand is aliased to a subpackage on the other hand. Or package to package, or subpackage to subpackage.

For instance for preact the alias section of package.json looks like

"alias": {
    "react": "preact/compat",
    "react-dom/test-utils": "preact/test-utils",
    "react-dom": "preact/compat",
    "react/jsx-runtime": "preact/jsx-runtime"
  }