[CLNP-7712] chore: add exports field in package.json for module resolution #270
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.
External Contributions
This project is not yet set up to accept pull requests from external contributors.
If you have a pull request that you believe should be accepted, please contact
the Developer Relations team [email protected] with details
and we'll evaluate if we can setup a CLA to allow for the contribution.
For Internal Contributors
[CLNP-7712](https://sendbird.atlassian.net/browse/CLNP-7712)
Description Of Changes
metro.config.js 에서 unstable_enablePackageExports 옵션과 resolverMainFields 셋팅 처리에 따라서 package.json 에 exports 필드가 존재하지 않을때 폴백 처리로 인해서 동일한 패키지가 cjs, esm으로 중복 로드 되는 경우가 있습니다. 사용자가 어떤 셋팅을하더라도 동일한 모듈이 로드되도록 exports 를 추가하였습니다
ex) 사용자가 unstable_enablePackageExports 를 true resolverMainFields 의 우선순위를 main 으로 하는경우
샘플의 chat-js 에는 exports 필드가 존재하기때문에 esm 모듈을 사용,
샘플에서 사용하는 uikit-react-native 에서는 main의 cjs 를 사용 -> uikit-tools 의 cjs 사용 -> chat-js의 cjs사용
Types Of Changes
What types of changes does your code introduce to this project?
Put an
xin the boxes that apply_