Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export typings in package.json #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

abd-almofleh
Copy link

When importing the module using:

import ApexSankey from "apexsankey";

Typescript complain about the types not being loaded to respect the exports field in package.json:

image

To solve this, according to package.json Conditional exports we need to specify the file path for the types to the import condition to be loaded.

{
  "exports": {
    ".": {
      "import": {
        "types": "./index.d.ts",
        "default": "./apexsankey.es.min.js"
      }
    }
  }
}

@abd-almofleh abd-almofleh changed the title refactor: update package.json to improve type definitions and exports… Export typings in package.json Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant