From 81300a1beda25adb3d39e92c9e083ba6fa6904bd Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 15 Jul 2024 12:28:23 +0200 Subject: [PATCH] Do not put the URL in the path --- libs/remix-url-resolver/src/resolve.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/remix-url-resolver/src/resolve.ts b/libs/remix-url-resolver/src/resolve.ts index b1225ccdb5..cea8f95bfa 100644 --- a/libs/remix-url-resolver/src/resolve.ts +++ b/libs/remix-url-resolver/src/resolve.ts @@ -139,6 +139,7 @@ export class RemixURLResolver { async handleNpmImport(url: string): Promise { if (!url) throw new Error('url is empty') + let fetchUrl = url const isVersionned = semverRegex().exec(url.replace(/@/g, '@ ').replace(/\//g, ' /')) if (this.getDependencies && !isVersionned) { try { @@ -174,7 +175,7 @@ export class RemixURLResolver { } if (version) { const versionSemver = semver.minVersion(version) - url = url.replace(pkg, `${pkg}@${versionSemver.version}`) + fetchUrl = url.replace(pkg, `${pkg}@${versionSemver.version}`) } } } @@ -189,7 +190,7 @@ export class RemixURLResolver { // get response from all urls for (let i = 0; i < npm_urls.length; i++) { try { - const req = npm_urls[i] + url + const req = npm_urls[i] + fetchUrl const response: AxiosResponse = await axios.get(req, { transformResponse: []}) content = response.data break