Skip to content

Commit 6a970c6

Browse files
authored
feat: Set "react-native" condition when using Package Exports (#1862)
1 parent 71be657 commit 6a970c6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/cli-plugin-metro/src/tools/loadMetroConfig.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export interface MetroConfig {
4444
) => any;
4545
resolverMainFields: string[];
4646
platforms: string[];
47+
unstable_conditionNames: string[];
4748
};
4849
serializer: {
4950
getModulesRunBeforeMainModule: () => string[];
@@ -91,6 +92,7 @@ export const getDefaultConfig = (ctx: ConfigLoadingContext): MetroConfig => {
9192
),
9293
resolverMainFields: ['react-native', 'browser', 'main'],
9394
platforms: [...Object.keys(ctx.platforms), 'native'],
95+
unstable_conditionNames: ['import', 'require', 'react-native'],
9496
},
9597
serializer: {
9698
// We can include multiple copies of InitializeCore here because metro will

0 commit comments

Comments
 (0)