From 2348e75fb197ced630fd8d72d86e255962d0b02d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barth=C3=A9l=C3=A9my=20Ledoux?= Date: Thu, 20 Sep 2018 00:44:59 -0500 Subject: [PATCH] fix(dev): Prevent files at node_modules from being watched (close: #855) (#856) When running vuepress dev, chorkidar is set to observe all addition/removal of md files inside the entity folder. `node_modules` is one of these folders and can contain tons of subfolders. It mostly never contains any md files anyway, and even rarely has any hot additions of md files. Another perk of this perf fix is this: If for some reason a developer decided to publish a folder with a weird name in its module. It will not prevent `vuepress dev` from loading. --- lib/dev.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dev.js b/lib/dev.js index ba909d991c..08f828d06c 100644 --- a/lib/dev.js +++ b/lib/dev.js @@ -35,7 +35,7 @@ module.exports = async function dev (sourceDir, cliOptions = {}) { '.vuepress/components/**/*.vue' ], { cwd: sourceDir, - ignored: '.vuepress/**/*.md', + ignored: ['.vuepress/**/*.md', 'node_modules'], ignoreInitial: true }) pagesWatcher.on('add', update)