Skip to content

package.json exports have types in wrong place #624

@jakebailey

Description

@jakebailey

For example:

#349 did this incorrectly; types needs to appear first if the intent is to share it between the two other conditions, like:

    "exports": {
      ".": {
        "types": "./lib/index.d.ts"
        "import": "./lib/index.mjs",
        "require": "./lib/index.js"
      }
    },

The only reason it "works" in the existing case is because TS matches require, finds the .js, then looks for .d.ts next to it, and that works. But for import, it finds .mjs, then looks for .d.mts next to it, and finds nothing, so fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions