Skip to content

Commit

Permalink
fix(react-native): fix: add mainFields option for pnpm resolver
Browse files Browse the repository at this point in the history
To fix the issue: sometimes resolver look for wrong entry file

closed #9743, #15763
  • Loading branch information
Singloo committed Mar 29, 2023
1 parent 86844d7 commit 6ad0664
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-native/plugins/metro-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function getPnpmResolver(extensions: string[]) {
useSyncFileSystemCalls: true,
modules: [join(workspaceRoot, 'node_modules'), 'node_modules'],
conditionNames: ['native', 'browser', 'require', 'default'],
mainFields: ['react-native', 'browser', 'main']
mainFields: ['react-native', 'browser', 'main'],
});
}
return resolver;
Expand Down

0 comments on commit 6ad0664

Please sign in to comment.