fix: fix HMR failure for @include markdown files due to cache key mismatch

pull/5035/head
yyznm 2 weeks ago
parent 5e0d7dab83
commit d51a760e0f

@ -110,10 +110,16 @@ export async function createMarkdownToVueRenderFn(
getPageDataTransformer(dynamicRoute?.[1]!)
].filter((fn) => fn != null)
const originalRelativePath = slash(path.relative(srcDir, file))
file = rewrites.get(file) || file
const relativePath = slash(path.relative(srcDir, file))
const cacheKey = JSON.stringify({ src, ts, relativePath })
const cacheKey = JSON.stringify({
src,
ts,
relativePath: originalRelativePath
})
if (options.cache !== false) {
const cached = cache.get(cacheKey)
if (cached) {

Loading…
Cancel
Save