Remove unnecessary 'browser' exports to fix Jest integration #435
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #396
This library is exporting multiple builds (umd/module/cjs) but duplicates the CJS ("require") build as the "browser" build. This is not required for this project; "browser" is supposed to be used for distinguishing browser-specific versions (e.g. if using Node
crypto
package when built for NodeJS vs. using browser-standard cryptography when built for browsers), whereas this project does not use any node-specific or browser-specific builds.Jest's latest update reworks their import handling to properly support package.json
exports
, which has revealed this issue (Jest is now — correctly — using thebrowser
import, but failing because it cannot handle esm modules)By removing the browser entries entirely, all build systems will pick the appropriate build based on whether they want
umd
,import
, orrequire
. This seems to be in line with the original intent of the definitions.Note also that with this change, the
config/node-13-exports.js
build config could also be changed to move the files instead of copying them, as nothing will require the old.module.js
versions any more (unless users are importing them directly). I have left this change out to keep things minimal and fully backwards compatible.