Nodemon watch option broken

末鹿安然 提交于 2019-12-04 08:21:51

This seems to be a bug with nodemon itself, because I was able to reproduce it using the simple nodemon command :

> nodemon --watch app server.js
[nodemon] v1.2.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: app/**/*
[nodemon] starting `node server.js`
[nodemon] watching 72,981 files - this might cause high cpu usage. To reduce use "--watch"

The default behavior of nodemon is to watch all the directories in the root of your project, and to ignore some directories like node_modules, bower_components or .sass_cache. This default ignore don't work actually, but was fixed in this PR. Applying this fix, my output was just as expected.

> nodemon --watch app server.js
[nodemon] v1.2.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: app/**/*
[nodemon] starting `node server.js`

I tested using both configurations, and even with the warning, my nodemon was not refreshing on a file change that is not in the specified watched directory, and working just as expected with no performance issue. It's more likely a false-positive warning to me.

But for now I advice you to stay with your ignore rule until this is merged into nodemon or another workaround is found.

Here some related issues about that : #46, #366 and #32

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!