我正在使用gulp-nodemon
config 目录只包含一个文件 server.js。
$.nodemon({
script: 'config/server.js',
watch: ['config/**/*.js']
})
.on('restart', function () {
setTimeout(function () {
$.livereload.changed();
}, 1000);
});
输出:
[gulp] [nodemon] v1.2.1
[gulp] [nodemon] to restart at any time, enter `rs`
[gulp] [nodemon] watching: config/**/*.js
[gulp] [nodemon] starting `node config/server.js`
[gulp] [nodemon] watching 34,325 files - this might cause high cpu usage. To reduce use "--watch".
如果我包含一个忽略选项,它会修复。
ignore: [
'node_modules/**',
'bower_components/**'
]
为什么即使我告诉它只查看配置目录,nodemon 也会查看所有内容?
它也从输出中出现,它只监视配置目录[nodemon] watching: config/**/*.js