Skip to content

Commit

Permalink
feat: Set "react-native" condition when using Package Exports (#1862)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntie committed 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
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.