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