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

Add adyen-web package.json to exports #1056

Merged
merged 1 commit into from
May 10, 2021

Conversation

gareth-canva
Copy link
Contributor

Summary

It's not an uncommon pattern for bundlers/tools to do require.resolve(path.join('@adyen/adyen-web', 'package.json')) in order to find the location of a package's package.json file. However, for packages that have adopted the exports field in their package.json, this pattern won't work unless package.json itself is listed as an 'exported'/accessible file for the module. Here are some related discussions around this pattern: nodejs/node#33460 and nodejs/node#49445

A similar issue arose and was fixed by #837 for the CSS bundle in adyen-web.

This change allows the above pattern using require.resolve to work for @adyen/adyen-web.

@marcperez since you fixed the exports issue for the CSS bundle previously.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@marcperez
Copy link
Contributor

Hi @gareth-canva,

Thanks for the PR! Looks good to me.
Out of curiosity, did you encounter this issue with any particular tool or bundler?

@marcperez marcperez merged commit ddaf612 into Adyen:master May 10, 2021
@marcperez marcperez mentioned this pull request May 10, 2021
@gareth-canva
Copy link
Contributor Author

Thanks for the quick turnaround @marcperez. The tooling I ran into this issue with was internal, so nothing to worry too much about in this particular instance.

@marcperez
Copy link
Contributor

Good to know anyway! Thanks for your contribution! 👍

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.

2 participants