Skip to content

Commit 3f488d0

Browse files
kimburgessQingWei-Li
authored andcommitted
perf(serve): exclude node_modules from livereload (#17)
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.
1 parent 2f0bed4 commit 3f488d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/commands/serve.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ module.exports = function (path, openInBrowser, port) {
2727
server.use(serveStatic(path))
2828
server.listen(port)
2929
lrserver.createServer({
30-
exts: ['md']
30+
exts: ['md'],
31+
exclusions: ['node_modules/']
3132
}).watch(path)
3233

3334
if (openInBrowser) {

0 commit comments

Comments
 (0)