【问题标题】:JS includePattern not working: "There are no input files to process."JS includePattern 不起作用:“没有要处理的输入文件。”
【发布时间】:2022-02-25 03:38:20
【问题描述】:
module.exports = {
    recurseDepth: 5,
    templates: {
        default: {
            outputSourceFiles: false,
        }
    },
    source: {
        includePattern: '.+\.js$',
        exclude: ['./node_modules'],
    },
    opts: {
        recurse: true,
        template: './projects/documentation/template',
        destination: './lospec-data/documentation',
        //recurse: true
    }
};

每次运行时,我都会收到“没有要处理的输入文件。”

如果我这样做 source.input: ['test.js'] 它只适用于该文件。但它不会在我的文件夹中查找 .js 文件。

我已尝试将其设置为 .+\\.js(doc|x)?$,文档称它会匹配所有 .js 文件(并且是默认设置),但它也不匹配。我为 includePattern 尝试了很多不同的方法,但它们都没有返回任何内容。

【问题讨论】:

    标签: jsdoc


    【解决方案1】:

    要让 jsdoc 引用子文件夹,您需要设置“opts”参数。下面的例子在jsdocs/的子文件夹中查找所有js文件:

    jsdoc.config:

    {
        "tags": {
          "allowUnknownTags": true,
          "recurseDepth": 10,
          "dictionaries": ["jsdoc", "closure"]
        },
        "source": {
          "include": ["./jsdoc"],
          "includePattern": ".+\\.js$"
        },
        "opts": {
          "destination": "docs",
          "recurse": true,
          "readme": "README.md"
      },
        "sourceType": "module"
      }
    

    【讨论】:

      【解决方案2】:

      显然你需要包括“。”否则根本不会包含任何内容...

      source: {
          include: ['.'],
      

      【讨论】:

        猜你喜欢
        • 2014-08-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-07-14
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多