Nodemon - 排除文件 [英] Nodemon - exclusion of files
问题描述
我想从 NodeMon 的监控中排除一些特定的文件.我该怎么做?
I would like to exclude some specific files from monitoring of NodeMon. How can I do this?
我现有的配置:
nodemon: {
all: {
script: 'app.js',
options: {
watchedExtensions: ['js']
}
}
推荐答案
为了让NodeMon忽略一堆监控文件,可以这样启动
In order to make NodeMon ignore a bunch of files from monitoring, you can start it as
nodemon --ignore PATTERN [--ignore PATTERN2]
其中 PATTERN 是特定文件、目录或通配符模式的名称.确保如果您使用通配符,它会被转义.
where PATTERN is the name of a specific file, directory, or wildcard pattern. Make sure that if you use a wildcard, it is escaped.
例如
nodemon --ignore 'lib/*.js' --ignore README
<小时>
或者,如果您想配置该行为,请尝试在当前工作目录或主目录中创建一个 nodemon.json
文件.您可以通过在此配置文件中添加以下内容来配置忽略某些文件:
Alternatively, if you want to configure that behaviour instead, try creating a nodemon.json
file in your current working directory, or your home directory. You can configure ignoring some files by adding something like the following to this config file:
{
"ignore": ["lib/*.js", "README"]
}
有关更多详细信息,请参阅 https://github.com/remy/nodemon 上的 README 文件.
Refer the README file at https://github.com/remy/nodemon for more details.
这篇关于Nodemon - 排除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!