Skip to content
This repository was archived by the owner on Sep 2, 2023. It is now read-only.
This repository was archived by the owner on Sep 2, 2023. It is now read-only.

Docs/review of various affects of type field #475

@bmeck

Description

@bmeck

"type" in package.json has a few affects:

  • when loading the main entrypoint of the process or a worker thread it can determine which loader to use: ESM loader (if package.type is "module") vs CJS loader (if type is anything else? [this seems a forwards compat bug?] )
  • manipulates format resolution within its package boundary
    • .js and extension-less files in particular
    • also .node
  • causes the CJS loader to error for CJS format files that end in .js within that package boundary (not extension-less files?)

We should probably document and/or bugfix these if they are not the expected behavior.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions