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

Needs a main entry in package.json #9

Closed
achingbrain opened this issue Mar 24, 2021 · 2 comments
Closed

Needs a main entry in package.json #9

achingbrain opened this issue Mar 24, 2021 · 2 comments

Comments

@achingbrain
Copy link
Contributor

Browserify doesn't understand exports in package.json. Even if it did, it'd probably take the browser conditional export which would give it esm which would make it explode without extra config.

This module should be published with a main field that provides a cjs fallback for environments that don't understand exports or esm.

@ljharb
Copy link

ljharb commented Mar 24, 2021

Either way, the "browser" conditional export should be CJS, just like the top-level "browser" field itself.

achingbrain referenced this issue in achingbrain/cborg Mar 25, 2021
We can't use the `**` operator as right now it gets transpiled to `Math.pow`
which only takes Numbers.

Similarly, trying to avoid referencing node globals to get a `Buffer` instance
causes similar problems now that bundlers don't tend to come with node polyfills
any more.

Swaps the use of `**` for the BigInt literal result of the calculation and uses
the `Buffer` module to ensure compatibility.

Fixes #7
Fixes #8

Please publish with a `main` field to also fix #9.
@achingbrain
Copy link
Contributor Author

Fixed in #11

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 a pull request may close this issue.

2 participants