Add adyen-web package.json to exports #1056
Merged
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.
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'spackage.json
file. However, for packages that have adopted theexports
field in theirpackage.json
, this pattern won't work unlesspackage.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#49445A 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.