<small id='vBJUV'></small><noframes id='vBJUV'>

    <legend id='vBJUV'><style id='vBJUV'><dir id='vBJUV'><q id='vBJUV'></q></dir></style></legend>
  • <i id='vBJUV'><tr id='vBJUV'><dt id='vBJUV'><q id='vBJUV'><span id='vBJUV'><b id='vBJUV'><form id='vBJUV'><ins id='vBJUV'></ins><ul id='vBJUV'></ul><sub id='vBJUV'></sub></form><legend id='vBJUV'></legend><bdo id='vBJUV'><pre id='vBJUV'><center id='vBJUV'></center></pre></bdo></b><th id='vBJUV'></th></span></q></dt></tr></i><div id='vBJUV'><tfoot id='vBJUV'></tfoot><dl id='vBJUV'><fieldset id='vBJUV'></fieldset></dl></div>
        • <bdo id='vBJUV'></bdo><ul id='vBJUV'></ul>
        <tfoot id='vBJUV'></tfoot>

        Nodemon监视选项损坏

        时间:2023-05-28

          <legend id='43RoO'><style id='43RoO'><dir id='43RoO'><q id='43RoO'></q></dir></style></legend>

          <i id='43RoO'><tr id='43RoO'><dt id='43RoO'><q id='43RoO'><span id='43RoO'><b id='43RoO'><form id='43RoO'><ins id='43RoO'></ins><ul id='43RoO'></ul><sub id='43RoO'></sub></form><legend id='43RoO'></legend><bdo id='43RoO'><pre id='43RoO'><center id='43RoO'></center></pre></bdo></b><th id='43RoO'></th></span></q></dt></tr></i><div id='43RoO'><tfoot id='43RoO'></tfoot><dl id='43RoO'><fieldset id='43RoO'></fieldset></dl></div>

              <small id='43RoO'></small><noframes id='43RoO'>

                <bdo id='43RoO'></bdo><ul id='43RoO'></ul>
                <tfoot id='43RoO'></tfoot>
                  <tbody id='43RoO'></tbody>
                • 本文介绍了Nodemon监视选项损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在使用 gulp-nodemon

                  config 目录只包含一个文件 server.js.

                  config directory includes only one file, 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".
                  

                  如果我包含一个忽略选项,它会修复.

                  If i include an ignore option it fixes.

                  ignore: [
                    'node_modules/**',
                    'bower_components/**'
                  ]
                  

                  即使我告诉它只看配置目录,为什么 nodemon 还要看一切?

                  Why does nodemon watch everything even when I tell it to watch only config directory?

                  从输出中也可以看出,它只监视配置目录 [nodemon] 监视:config/**/*.js

                  Also it appears from the output it only watches the config directory [nodemon] watching: config/**/*.js

                  推荐答案

                  这似乎是 nodemon 的错误 本身,因为我能够使用简单的 nodemon 命令重现它:

                  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"
                  

                  nodemon 的默认行为是监视项目根目录下的所有目录,并忽略一些目录,如 node_modulesbower_components.sass_cache.这个默认的 ignore 实际上不起作用,但已在 此 PR 中修复.应用此修复程序,我的输出与预期一样.

                  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`
                  

                  我使用这两种配置进行了测试,即使出现警告,我的 nodemon 也没有刷新不在指定 watched 目录中的文件更改,并且正常工作正如预期的那样,没有性能问题.这更可能是对我的误报警告.

                  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.

                  但现在我建议您坚持使用 ignore 规则,直到将其合并到 nodemon 或找到其他解决方法.

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

                  这里有一些相关的问题:#46, #366 和 #32

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

                  这篇关于Nodemon监视选项损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:EcmaScript 6 的非法构造函数 下一篇:React.js app.js 文件大小

                  相关文章

                  最新文章

                • <i id='LFySl'><tr id='LFySl'><dt id='LFySl'><q id='LFySl'><span id='LFySl'><b id='LFySl'><form id='LFySl'><ins id='LFySl'></ins><ul id='LFySl'></ul><sub id='LFySl'></sub></form><legend id='LFySl'></legend><bdo id='LFySl'><pre id='LFySl'><center id='LFySl'></center></pre></bdo></b><th id='LFySl'></th></span></q></dt></tr></i><div id='LFySl'><tfoot id='LFySl'></tfoot><dl id='LFySl'><fieldset id='LFySl'></fieldset></dl></div>
                    1. <small id='LFySl'></small><noframes id='LFySl'>

                        <bdo id='LFySl'></bdo><ul id='LFySl'></ul>
                    2. <tfoot id='LFySl'></tfoot><legend id='LFySl'><style id='LFySl'><dir id='LFySl'><q id='LFySl'></q></dir></style></legend>