|
|
|
@ -67,11 +67,13 @@ export async function createMarkdownToVueRenderFn(
|
|
|
|
|
const relativePath = slash(path.relative(srcDir, file))
|
|
|
|
|
const cacheKey = JSON.stringify({ src, file })
|
|
|
|
|
|
|
|
|
|
if (isBuild || options.cache !== false) {
|
|
|
|
|
const cached = cache.get(cacheKey)
|
|
|
|
|
if (cached) {
|
|
|
|
|
debug(`[cache hit] ${relativePath}`)
|
|
|
|
|
return cached
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const start = Date.now()
|
|
|
|
|
|
|
|
|
@ -125,7 +127,8 @@ export async function createMarkdownToVueRenderFn(
|
|
|
|
|
const env: MarkdownEnv = {
|
|
|
|
|
path: file,
|
|
|
|
|
relativePath,
|
|
|
|
|
cleanUrls
|
|
|
|
|
cleanUrls,
|
|
|
|
|
includes
|
|
|
|
|
}
|
|
|
|
|
const html = md.render(src, env)
|
|
|
|
|
const {
|
|
|
|
@ -243,7 +246,9 @@ export async function createMarkdownToVueRenderFn(
|
|
|
|
|
deadLinks,
|
|
|
|
|
includes
|
|
|
|
|
}
|
|
|
|
|
if (isBuild || options.cache !== false) {
|
|
|
|
|
cache.set(cacheKey, result)
|
|
|
|
|
}
|
|
|
|
|
return result
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|