Skip to content

Documenting .mjs, .jsx or files with any other extension

Lloyd Brookes edited this page Jun 1, 2021 · 1 revision

By default, jsdoc (used internally by jsdoc2md) does not recognise .mjs files. To override this, you must update the includePattern in the jsdoc configuration. Store the new pattern in a file called jsdoc.conf. This pattern includes .js, .jsdoc, .jsx and .mjs:

$ cat jsdoc.conf
{
  "source": {
    "includePattern": ".+\\.(js(doc|x)?|mjs)$"
  }
}

Now, launch jsdoc2md using this new jsdoc configuration, for example:

$ jsdoc2md -c jsdoc.conf index.mjs > docs.md
Clone this wiki locally