From 6048eb9f0077e174438b21e492b65acc6bfb64ab Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Tue, 29 May 2018 23:12:19 +0800 Subject: [PATCH] fix($dev): using config.yml/toml doesn't reload changes (close: #520) --- lib/dev.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/dev.js b/lib/dev.js index dbc7c1c187..cfb7dc4bf7 100644 --- a/lib/dev.js +++ b/lib/dev.js @@ -44,8 +44,13 @@ module.exports = async function dev (sourceDir, cliOptions = {}) { // watch config file const configWatcher = chokidar.watch([ - path.join(sourceDir, '.vuepress/config.js') - ], { ignoreInitial: true }) + '.vuepress/config.js', + '.vuepress/config.yml', + '.vuepress/config.toml' + ], { + cwd: sourceDir, + ignoreInitial: true + }) configWatcher.on('change', update) // also listen for frontmatter changes from markdown files