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

Update package and build scripts to ESM #336

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wipeautcrafter
Copy link

Issue

When trying to import Pickr in a TypeScript project, the types add an extra .default.
This means that instead of Pickr.create, TypeScript exposes Pickr.default.create.

import Pickr from '@simonwep/pickr'

const pickr = Pickr.create({
//                  ^^^^^^ Property 'create' does not exist on type (...)

Solution

Changing the type to module in package.json seems to fix the issue.
The build scripts had to be updated to ESM following this change.

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