Skip to content

Add react-native export to package.json#3953

Merged
HackbrettXXX merged 3 commits intoparallax:masterfrom
stefan-schweiger:react-native
Feb 4, 2026
Merged

Add react-native export to package.json#3953
HackbrettXXX merged 3 commits intoparallax:masterfrom
stefan-schweiger:react-native

Conversation

@stefan-schweiger
Copy link
Contributor

- Add react-native export entry pointing to ES module build
- Fixes parallax#3935
@HackbrettXXX
Copy link
Collaborator

Not a fan of adding very framework-specific stuff to a generic library like jspdf. IMO, react native should adopt standard behavior and not expect the whole ecosystem to adapt to it.

@stefan-schweiger
Copy link
Contributor Author

I need to look up the support for it, but what about "default" to esm and only specify that node needs a special version?

@stefan-schweiger
Copy link
Contributor Author

So seems like that should work. But typescript recommends to use this order:

".": {
  "types": "./types/index.d.ts",
  "node": "./dist/jspdf.node.min.js",
  "default": "./dist/jspdf.es.min.js"
},

@HackbrettXXX
Copy link
Collaborator

Adding "default" is probably a good idea. I would keep the "browser" export, though.

@stefan-schweiger
Copy link
Contributor Author

Take a look now

Copy link
Collaborator

@HackbrettXXX HackbrettXXX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the trailing comma is illegal.

@stefan-schweiger
Copy link
Contributor Author

Sorry you are right. Fixed now.

@HackbrettXXX HackbrettXXX merged commit 3b92c7d into parallax:master Feb 4, 2026
7 checks passed
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.

Add export for react-native

2 participants