diff --git a/packages/markdown/src/plugins/importCodePlugin/resolveImportCode.ts b/packages/markdown/src/plugins/importCodePlugin/resolveImportCode.ts index 1ea9841e3e..8e16e6b231 100644 --- a/packages/markdown/src/plugins/importCodePlugin/resolveImportCode.ts +++ b/packages/markdown/src/plugins/importCodePlugin/resolveImportCode.ts @@ -1,4 +1,4 @@ -import { fs, path } from '@vuepress/utils' +import { colors, fs, logger, path } from '@vuepress/utils' import type { MarkdownEnv } from '../../types.js' import type { ImportCodeTokenMeta } from './types.js' @@ -15,6 +15,9 @@ export const resolveImportCode = ( // if the importPath is relative path, we need to resolve it // according to the markdown filePath if (!filePath) { + logger.error( + `Import file ${colors.magenta(importPath)} can not be resolved` + ) return { importFilePath: null, importCode: 'Error when resolving path', @@ -25,6 +28,7 @@ export const resolveImportCode = ( // check file existence if (!fs.existsSync(importFilePath)) { + logger.error(`Import file ${colors.magenta(importPath)} not found`) return { importFilePath, importCode: 'File not found',