【问题标题】:Force nodemon to watch file from node_modules强制 nodemon 从 node_modules 监视文件
【发布时间】:2019-02-20 04:43:51
【问题描述】:

您好,是否有机会让nodemon 监视node_modules 中特定模块的更改

我已经像这样启动了nodemon

nodemon index.js --watch 'node_modules/specific_module/**

我也试过nodemon.json文件

"watch": [
  "node_modules/specific_module/**"
]

但无济于事。有没有办法实现这种行为或node_modules 中的任何内容无论我做什么都会被永远忽略?

【问题讨论】:

标签: nodemon


【解决方案1】:

Nodemon:查看模块文件夹

正如 @variable 在 cmets 中提到的,这里是一个 nodemon.json 包含 node_modules(显然排除 .git

{
"ignoreRoot": [".git"]
}

来自docs

假设您确实想查看 node_modules 目录。您必须覆盖ignoreRoot。如果您希望在每个项目的基础上进行此操作,请将配置添加到本地 nodemon.json。如果您希望所有项目都使用它,请将其添加到 $HOME/nodemon.json:

【讨论】:

    猜你喜欢
    • 2015-01-24
    • 2021-12-12
    • 2017-03-08
    • 2018-07-11
    • 2018-06-03
    • 1970-01-01
    • 2016-07-22
    • 2017-07-08
    • 2020-09-30
    相关资源
    最近更新 更多