-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add conditional exports to package.json #815
Conversation
package.json
Outdated
"exports": { | ||
"import": "./dist/signature_pad.js", | ||
"require": "./dist/signature_pad.umd.js", | ||
"default": "./dist/signature_pad.umd.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it has a problem with the trailing comma in this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 💯
## [5.0.5](v5.0.4...v5.0.5) (2025-03-14) ### Bug Fixes * Add conditional exports to package.json ([#815](#815)) ([005a090](005a090))
🎉 This PR is included in version 5.0.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I'm in the process of updating to Node 22 and I ran into an issue with the default export not working:
This PR fixes compatibility with TypeScript's
"nodenext"
module resolution. The"module"
property is non-standard and not supported by node. The official way is "Conditional Exports":https://nodejs.org/docs/latest-v22.x/api/packages.html#conditional-exports
This is needed for packages that support CommonJS and ESM where the
"type"
is omitted or set to"commonjs"
.(Note: "require" could be omitted, but I was more explicit including both "require" and "default")