Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ?module use latest dependency version when many are given #123

Open
dakami opened this issue Aug 12, 2018 · 2 comments
Open

Make ?module use latest dependency version when many are given #123

dakami opened this issue Aug 12, 2018 · 2 comments
Labels

Comments

@dakami
Copy link

dakami commented Aug 12, 2018

Attempting to acquire https://unpkg.com/[email protected]/es/index.js?module yields:

import React, { Component } from "https://unpkg.com/react@^15.x.x || ^16.x.x?module";

@mjackson
Copy link
Member

Ah, good catch. This is because we pull the version straight from the peerDependencies and dependencies in the package.json file. react-table version 6.8.6 has:

screen shot 2018-08-27 at 9 27 01 am

In this case, since it's an ||, we should probably just default to using the latest version of all the options listed.

@mjackson mjackson added the bug label Aug 27, 2018
@mjackson mjackson changed the title Miss on the ?module injector Make ?module use latest dependency version when many are given Aug 27, 2018
@natevw
Copy link

natevw commented Mar 26, 2019

Hmm, this might be a separate issue but right now I'm not even seeing the peerDependencies value get used?

If I fetch https://unpkg.com/[email protected]/hooks/dist/hooks.mjs?module, the preact import gets rewritten to https://unpkg.com/preact@latest?module even though https://unpkg.com/[email protected]/hooks/package.json specifies:

"peerDependencies": {
    "preact": "^10.0.0-alpha.0"
 }

Since preact@latest redirects to [email protected], the re-written import won't be compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants