Skip to content

Commit

Permalink
perf(serve): exclude node_modules from livereload (#17)
Browse files Browse the repository at this point in the history
Running serve on a project using npm for package management could result
in a high number file watchers. Depending on the contents of
dependancies this could result in node exiting with a ENOSPC error due
to exceeding fs.inotify.max_user_watches.
  • Loading branch information
kimburgess authored and QingWei-Li committed Jul 12, 2017
1 parent 2f0bed4 commit 3f488d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/commands/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ module.exports = function (path, openInBrowser, port) {
server.use(serveStatic(path))
server.listen(port)
lrserver.createServer({
exts: ['md']
exts: ['md'],
exclusions: ['node_modules/']
}).watch(path)

if (openInBrowser) {
Expand Down

0 comments on commit 3f488d0

Please sign in to comment.