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

Fixes Webpack 5 always picking node implementation because of package.json exports field #39

Merged
merged 1 commit into from
Dec 12, 2020

Conversation

wagich
Copy link
Contributor

@wagich wagich commented Dec 10, 2020

It seems like Webpack 5 now uses/respects the exports field in package.json (see https://webpack.js.org/guides/package-exports/). This leads to problems when importing jdenticon in a browser build, because atm. only the node implementations are present.

Additionally, AFAIK there seems to be no way to resolve (using resolve.alias f.ex.) a file that is not listed in the exports so no workaround is possible on the consuming side. From the webpack documentation:

When the exports field is specified, only these module requests are available. Any other requests will lead to a ModuleNotFound Error.

This pull request adds exports for browser implementations (only module-based) next to the node ones. The default is unchanged.

@wagich wagich changed the title Fixes Webpack 5 using node implementation because of package.json exports field Fixes Webpack 5 always picking node implementation because of package.json exports field Dec 10, 2020
@dmester dmester merged commit a8a6d73 into dmester:master Dec 12, 2020
@dmester
Copy link
Owner

dmester commented Dec 12, 2020

Thanks for the fix! It will be included in the next release.

dmester added a commit that referenced this pull request Dec 12, 2020
dmester added a commit that referenced this pull request Dec 12, 2020
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.

None yet

2 participants