From 03d0fcdb417e2f6e469bba410a7afa74c5b47bd7 Mon Sep 17 00:00:00 2001 From: Barthelemy Ledoux Date: Wed, 19 Sep 2018 11:36:25 -0500 Subject: [PATCH] fix(dev): Stop observing add/remove of files in node_modules Closes #855 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)