Update resolve.ts

If the entry is pointing to a github repo, redirect to correct handler instead of continuing
pull/5417/head
Tomer 3 months ago committed by Aniket
parent 5e08102364
commit 8981ceebb5
  1. 7
      libs/remix-url-resolver/src/resolve.ts

@ -174,6 +174,13 @@ export class RemixURLResolver {
version = deps[pkg]
}
if (version) {
// If the entry is pointing to a github repo, redirect to correct handler instead of continuing
if (version.startsWith("github:")) {
const [, repo, tag] = version.match(/github:([^#]+)#(.+)/);
const filePath = url.replace(/^[^/]+\//, '');
return yield this.handleGithubCall(repo, `blob/${tag}/${filePath}`);
}
const versionSemver = semver.minVersion(version)
fetchUrl = url.replace(pkg, `${pkg}@${versionSemver.version}`)
}

Loading…
Cancel
Save