Skip to content

Commit

Permalink
fix(build): cache key should consider file path (#948)
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Jul 8, 2022
1 parent bb41a9f commit 1daeaa1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/node/markdownToVue.ts
Expand Up @@ -43,8 +43,9 @@ export async function createMarkdownToVueRenderFn(
): Promise<MarkdownCompileResult> => {
const relativePath = slash(path.relative(srcDir, file))
const dir = path.dirname(file)
const cacheKey = JSON.stringify({ src, file })

const cached = cache.get(src)
const cached = cache.get(cacheKey)
if (cached) {
debug(`[cache hit] ${relativePath}`)
return cached
Expand Down Expand Up @@ -148,7 +149,7 @@ export async function createMarkdownToVueRenderFn(
deadLinks,
includes
}
cache.set(src, result)
cache.set(cacheKey, result)
return result
}
}
Expand Down

0 comments on commit 1daeaa1

Please sign in to comment.