-
Notifications
You must be signed in to change notification settings - Fork 417
Fix ESM compatibility #188
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
Conversation
This allows importing big.js in ESM packages without having to resolve
to the
import Big from 'big.js/big.mjs';
trick.
Fixes MikeMclGH-170.
|
Yes, it's overdue I suppose, although as I state in the linked issue "any use of the exports field prevents loading from subpaths of the package so it would probably cause issues for some users". Please use 2-space indentation and I'll accept it, thank you. |
|
Oops, I missed that – fixed |
|
Please let me know if I need to make any more changes here, happy to do it in order to get this merged. |
|
Thanks for the reminder. |
|
Thank you merging this so fast @MikeMcl – is there a chance we have a release with this change? It'd unblock us and be very much appreciated |
|
On my other library bignumber.js I just accepted a PR which used: "exports": {
".": {
"types": "./bignumber.d.ts",
"require": "./bignumber.js",
"import": "./bignumber.mjs",
"browser": "./bignumber.js"
},
"./package.json": "./package.json"
},Any comments? |
|
Hmm, the snippet looks similar enough to this PR and I think they're equivalent but I'm relatively inexperienced with TS/JS packaging so take my opinion with a grain of salt. :) |
|
Okay, I'm just going to look into it a bit more and will publish within a week. |
|
Published v6.2.0 to npm. |
|
Thank you very much, I can confirm it works perfectly for us. |
This allows importing big.js in ESM packages without having to resolve
to the
trick.
Fixes GH-170.