Skip to content

Commit

Permalink
feat: Set "react-native" condition when using Package Exports (react-…
Browse files Browse the repository at this point in the history
  • Loading branch information
huntie authored Mar 13, 2023
1 parent 71be657 commit 6a970c6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/cli-plugin-metro/src/tools/loadMetroConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export interface MetroConfig {
) => any;
resolverMainFields: string[];
platforms: string[];
unstable_conditionNames: string[];
};
serializer: {
getModulesRunBeforeMainModule: () => string[];
Expand Down Expand Up @@ -91,6 +92,7 @@ export const getDefaultConfig = (ctx: ConfigLoadingContext): MetroConfig => {
),
resolverMainFields: ['react-native', 'browser', 'main'],
platforms: [...Object.keys(ctx.platforms), 'native'],
unstable_conditionNames: ['import', 'require', 'react-native'],
},
serializer: {
// We can include multiple copies of InitializeCore here because metro will
Expand Down

0 comments on commit 6a970c6

Please sign in to comment.