Skip to content

Commit c5297c7

Browse files
rozelefacebook-github-bot
authored andcommitted
Do not override metro.config.js settings (#20705)
Summary: React Native overrides the `metro.config.js` settings for, e.g., `hasteImplModulePath`, which prevents us from adding a `metro.config.js` file to the repo for `react-native-windows` to allow us to resolve Haste modules at the top-level of the repo. This change ensures that if a user has a `metro.config.js` file, those settings are not overwritten by React Native. Pull Request resolved: #20705 Differential Revision: D9390146 Pulled By: hramos fbshipit-source-id: 5ccc137490410ace72d7b0e68f2bafcbb233c59f
1 parent 735be8b commit c5297c7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

local-cli/core/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ async function getCliConfig(): Promise<RNConfig> {
132132
);
133133

134134
config.transformer.assetRegistryPath = ASSET_REGISTRY_PATH;
135-
config.resolver.hasteImplModulePath = defaultConfig.hasteImplModulePath;
136-
config.resolver.platforms = defaultConfig.getPlatforms();
137-
config.resolver.providesModuleNodeModules = defaultConfig.getProvidesModuleNodeModules();
135+
config.resolver.hasteImplModulePath = config.resolver.hasteImplModulePath || defaultConfig.hasteImplModulePath;
136+
config.resolver.platforms = config.resolver.platforms || defaultConfig.getPlatforms();
137+
config.resolver.providesModuleNodeModules = config.resolver.providesModuleNodeModules || defaultConfig.getProvidesModuleNodeModules();
138138

139139
return {...defaultRNConfig, ...config};
140140
}

0 commit comments

Comments
 (0)