Skip to content

Commit 5cc4a2a

Browse files
Update loader.js
1 parent 598081f commit 5cc4a2a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

loader.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,13 @@ const parseModule = async (specifier, modulePathToFetch) => {
5050
extractPackageNameAndVersion
5151
);
5252
console.log(packageName);
53-
5453
const cachePath = join(cache, packageName, filePath);
5554
cacheMap.set(`file://${cachePath}`, modulePathToFetch);
55+
56+
if (existsSync(cachePath)) {
57+
return cachePath
58+
}
59+
5660
const code = await (await fetch(modulePathToFetch)).text();
5761
ensureFileSync(cachePath);
5862
writeFileSync(cachePath, code);

0 commit comments

Comments
 (0)