如何在目录上运行 jsdoc 忽略 .gitignore 文件

Har*_*eno 3 jsdoc

我可以在整个项目上运行 jsdoc

$ jsdoc -r .
Run Code Online (Sandbox Code Playgroud)

然而,这会生成 .js 文件内的 js 文件的文档node_modules。我如何告诉 jsdoc 不在 中的文件上运行.gitignore?

Gra*_*ath 5

使用像这样的配置文件怎么样?

$ jsdoc.js -c ./.jsdoc.conf.json
Run Code Online (Sandbox Code Playgroud)

./.jsdoc.conf.json

{
  "source": {
    "include": ["."],
    "includePattern": ".+\\.js(doc|x)?$",
    "excludePattern": "node_modules"
  }
}
Run Code Online (Sandbox Code Playgroud)

借自Stack 上的“生成 jsdoc 文档” 。