From 5bd9b7f40d995e1f5dd453c1cf8cc3af27330efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20G=C3=A5rd?= Date: Mon, 18 Jan 2021 15:29:32 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Tryggere=20h=C3=A5ndterin?= =?UTF-8?q?g=20av=20manifest=20URLer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bedre å bruke endsWith() for å sjekke etter filer, slik at man ikke med et uhell henter .map filer --- src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index 328976b..c96e0fd 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -23,7 +23,7 @@ function extractPathsFromCRAManifest(manifestObject: ManifestObject): string[] { const fileList = Object.entries(files).map(([name, path]) => ({name, path})) as {name: string, path: string}[]; entrypoints.forEach((entrypoint) => { - const matchingFile = fileList.find(file => file.path.includes(entrypoint)); + const matchingFile = fileList.find(file => file.path.endsWith(entrypoint)); if (matchingFile) { pathsToLoad.push(matchingFile.path);