diff --git a/lib/dev.js b/lib/dev.js index 6205cae828..8f7bdf4acf 100644 --- a/lib/dev.js +++ b/lib/dev.js @@ -26,12 +26,14 @@ module.exports = async function dev (sourceDir, cliOptions = {}) { console.error(chalk.red(err.stack)) }) } - + console.log(path.join(sourceDir, '**/*.md')) + console.log(path.resolve(sourceDir, '**/*.md')) // watch add/remove of files const pagesWatcher = chokidar.watch([ - path.join(sourceDir, '**/*.md'), - path.join(sourceDir, '.vuepress/components/**/*.vue') + '**/*.md', + '.vuepress/components/**/*.vue' ], { + cwd: sourceDir, ignored: '.vuepress/**/*.md', ignoreInitial: true })