Skip to content

Commit

Permalink
fix(dev): Prevent files at node_modules from being watched (close: #855
Browse files Browse the repository at this point in the history
…) (#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.
  • Loading branch information
elevatebart authored and ulivz committed Sep 20, 2018
1 parent f4f9e6b commit 2348e75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2348e75

Please sign in to comment.