Skip to content

Commit 1daeaa1

Browse files
authoredJul 8, 2022
fix(build): cache key should consider file path (#948)
1 parent bb41a9f commit 1daeaa1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

Diff for: ‎src/node/markdownToVue.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ export async function createMarkdownToVueRenderFn(
4343
): Promise<MarkdownCompileResult> => {
4444
const relativePath = slash(path.relative(srcDir, file))
4545
const dir = path.dirname(file)
46+
const cacheKey = JSON.stringify({ src, file })
4647

47-
const cached = cache.get(src)
48+
const cached = cache.get(cacheKey)
4849
if (cached) {
4950
debug(`[cache hit] ${relativePath}`)
5051
return cached
@@ -148,7 +149,7 @@ export async function createMarkdownToVueRenderFn(
148149
deadLinks,
149150
includes
150151
}
151-
cache.set(src, result)
152+
cache.set(cacheKey, result)
152153
return result
153154
}
154155
}

0 commit comments

Comments
 (0)