Skip to content

dd the types condition to the package.json#exports for TS 4.7+ #4333

@jsjames

Description

@jsjames

Today I used patch-package to patch framework7@7.1.5 for the project I'm working on.

This is required for TypeScript to work with packages that have exports when using the new moduleResolution: node16/nodenext/bundler settings. When those are not used then TypeScript just ignores package.json#exports - but when you make it aware of exports by using those options then it requires the types to be included in exports and not as the top-level key of package.json

I'm not sure if there is a more elegant way to specify the exports - especially since there are so many listed in the package.json file. I just augmented the ones for the bundled components.

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