feat(theme): improve auto-frontmatter error log (#383)

This commit is contained in:
pengzhanbo 2024-12-22 00:09:34 +08:00 committed by GitHub
parent 055bf6156c
commit a21d9ed0b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,7 +11,7 @@ import chokidar from 'chokidar'
import { createFilter } from 'create-filter'
import grayMatter from 'gray-matter'
import jsonToYaml from 'json2yaml'
import { fs, hash, path } from 'vuepress/utils'
import { colors, fs, hash, path } from 'vuepress/utils'
import { getThemeConfig } from '../loadConfig/index.js'
import { perfLog, perfMark } from '../utils/index.js'
import { readMarkdown, readMarkdownList } from './readFile.js'
@ -177,6 +177,10 @@ async function generator(file: AutoFrontmatterMarkdownFile): Promise<void> {
generate.checkCache(filepath)
}
catch (e) {
console.error(e)
console.error(
colors.red('[vuepress-theme-plume:auto-frontmatter] '),
`error in: ${colors.cyan(relativePath)}\n`,
e,
)
}
}