JS includePattern not working: "There are no input files to process."

Viewed 534
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
    }
};

Every time I run it I get "There are no input files to process."

If I do source.input: ['test.js'] it works for just that file. But it wont look for .js files in my folders.

I've tried setting it to .+\\.js(doc|x)?$ which the docs say will match all .js files (and is default), but that matches nothing as well. I've tried a bunch of different things for includePattern, and they all return nothing.

2 Answers

To get jsdoc to reference subfolders you need to set the "opts" param. The example below finds all js files in subfolders of jsdocs/:

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"
  }

Apparently you need to include "." or nothing will be included at all...

source: {
    include: ['.'],
Related