Skip to content

doc: ES module wrapper guide #34714

Closed
Closed
@fox1t

Description

@fox1t

📗 API Reference Docs Problem

  • Version: 14.7.0
  • Subsystem: ESM

Location

Affected URL(s):

Description

I was wondering if it would be better to write this example as:

{
  "type": "commonjs",
  "main": "./index.js",
  "exports": {
    "import": "./wrapper.mjs",
    "require": "./index.js"
  }
}

since its current form might be misleading for package maintainers that want to support both ESM and CommonJS contexts. Maybe what happened here could be prevented if the documentation was more clear.


  • I would like to work on this issue and
    submit a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.esmIssues and PRs related to the ECMAScript Modules implementation.moduleIssues and PRs related to the module subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions