Skip to content

Can't get --extension to work. #891

@gauntface

Description

@gauntface

With the following input file saved as index.js

import LogHelper from './internal/utils/LogHelper.mjs';

/**
 * WorkboxCore shares code across Workbox modules.
 * @module workbox-core
 */
class WorkboxCore {
  /**
   * Constructs a new WorkboxCore instance.
   */
  constructor() {
    this.INTERNAL = {
      logHelper: new LogHelper(),
    };
  }

  /**
   * This tests the documentation generation.
   */
  test() {

  }
}

export default new WorkboxCore();

I get the expected output:

$ documentation build packages/workbox-core/index.js -f md -e mjs
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

-   [workbox-core](#workbox-core)
-   [constructor](#constructor)
-   [test](#test)

## workbox-core

WorkboxCore shares code across Workbox modules.

## constructor

Constructs a new WorkboxCore instance.

## test

This tests the documentation generation.

If I change the file extension to mjs and run the command again (With or without --extension mjs), I get no output

$ documentation build packages/workbox-core/index.mjs -f md -e mjs
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents
  • What version of documentation.js are you using?: 5.2.2
  • How are you running documentation.js (on the CLI, Node.js API, Grunt, other?): CLI

Is there anyway to parse JS files with a different extension? .mjs will be used for future node modules so I suspect this will be a request sooner or later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions