forked from facebook/metro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "exports" special case handling for @babel/runtime
Summary: This is a workaround for facebook#984. It adds a specific exception in the resolver for `babel/runtime` to prevent asserting the `"import"` condition name on these modules (when using Package Exports). This is necessary so that the CJS version of these Babel helpers are resolved, which enable CJS/MJS interop for all other modules (given our current strategy of resolving both `"require"` and `"import"` in all other packages and using Babel-driven ESM compatibility). This workaround is removable if/when any of: - babel/babel#15643 is merged and updated in React Native. - We implement dynamic handling of `"require"` and `"import"` conditions via ESM support in a future version of Metro. Changelog: **[Experimental]** Fix `babel/runtime` issue when using Package Exports Differential Revision: D46107056 fbshipit-source-id: 6bf32ccf412cb57a1705a6ae3ee6d8c35cb306d5
- Loading branch information
1 parent
40f9f06
commit 03b42ab
Showing
2 changed files
with
62 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters