Skip to content

Commit 2348e75

Browse files
elevatebartulivz
authored andcommitted
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.
1 parent f4f9e6b commit 2348e75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/dev.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = async function dev (sourceDir, cliOptions = {}) {
3535
'.vuepress/components/**/*.vue'
3636
], {
3737
cwd: sourceDir,
38-
ignored: '.vuepress/**/*.md',
38+
ignored: ['.vuepress/**/*.md', 'node_modules'],
3939
ignoreInitial: true
4040
})
4141
pagesWatcher.on('add', update)

0 commit comments

Comments
 (0)