diff --git a/packages/@vuepress/core/lib/dev.js b/packages/@vuepress/core/lib/dev.js index bea646364b..cfcda7c57b 100644 --- a/packages/@vuepress/core/lib/dev.js +++ b/packages/@vuepress/core/lib/dev.js @@ -37,8 +37,12 @@ async function prepareServer (sourceDir, cliOptions = {}, context) { } // Curry update handler by update type - const spawnUpdate = (updateType) => - file => update(`${chalk.red(updateType)} ${chalk.cyan(file)}`) + const spawnUpdate = updateType => file => { + const target = path.join(sourceDir, file) + // Bust cache. + delete require.cache[target] + update(`${chalk.red(updateType)} ${chalk.cyan(file)}`) + } // watch add/remove of files const pagesWatcher = chokidar.watch([