Nodemon 不使用 --ignore 选项 [英] Nodemon not using the --ignore option

查看:79
本文介绍了Nodemon 不使用 --ignore 选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Expressjs 项目上使用 Nodemon.我的 package.json 中有以下内容:

I am using Nodemon on an Expressjs project. I have the following in my package.json:

"start": "nodemon server.js --ignore 'src/**'"

我尝试了 ignore glob 的几种变体,但每次当src/"中的文件发生更改时,它仍然会重新启动.

I have tried several variations of the ignore glob, but every time, it still restarts when a file in 'src/' changes.

我需要做什么才能让 Nodemon 忽略 src 目录?

What do I need to do to get Nodemon to ignore the src directory?

谢谢.

推荐答案

您可以尝试添加一个包含以下内容的配置 nodemon.json:

You can try to add a config nodemon.json with content below:

{
  "verbose": true,
  "ignore": ["src/*"]
}

"start": "nodemon server.js --config nodemon.json"

"start": "nodemon server.js --config nodemon.json"

参考:https://github.com/remy/nodemon

这篇关于Nodemon 不使用 --ignore 选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆