Skip to content

Commit 808b3c9

Browse files
huntiefacebook-github-bot
authored andcommitted
Restore 'import' in default Package Exports conditions (facebook#36902)
Summary: Pull Request resolved: facebook#36902 Reverts facebook#36584. Since we've come across example packages (typically targeting Node.js) which only distribute ESM, we believe it's more helpful to return to asserting the `"import"` condition by default, for maximum compatibility. The above issue and comments outline the pros/cons. Changelog: [General][Changed] - Default condition set for experimental Package Exports is now ['require', 'import', 'react-native'] Metro changelog: [Experimental] Package Exports unstable_conditionNames now defaults to ['require', 'import'] Reviewed By: robhogan Differential Revision: D44962143 fbshipit-source-id: 004172388916c902469b49cfc920ebe13c62c430
1 parent 3b4037e commit 808b3c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/metro-config/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function getDefaultConfig(
4242
resolver: {
4343
resolverMainFields: ['react-native', 'browser', 'main'],
4444
platforms: ['android', 'ios'],
45-
unstable_conditionNames: ['require', 'react-native'],
45+
unstable_conditionNames: ['require', 'import', 'react-native'],
4646
},
4747
serializer: {
4848
getPolyfills: () => require('@react-native/js-polyfills')(),

0 commit comments

Comments
 (0)