From c5297c75cb6da58a241c8f91b0d2fefbc5835a46 Mon Sep 17 00:00:00 2001 From: Eric Rozell Date: Sat, 18 Aug 2018 05:18:44 -0700 Subject: [PATCH] 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: https://github.com/facebook/react-native/pull/20705 Differential Revision: D9390146 Pulled By: hramos fbshipit-source-id: 5ccc137490410ace72d7b0e68f2bafcbb233c59f --- local-cli/core/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/local-cli/core/index.js b/local-cli/core/index.js index 1a9ab03db36031..7027706250a4c1 100644 --- a/local-cli/core/index.js +++ b/local-cli/core/index.js @@ -132,9 +132,9 @@ async function getCliConfig(): Promise { ); config.transformer.assetRegistryPath = ASSET_REGISTRY_PATH; - config.resolver.hasteImplModulePath = defaultConfig.hasteImplModulePath; - config.resolver.platforms = defaultConfig.getPlatforms(); - config.resolver.providesModuleNodeModules = defaultConfig.getProvidesModuleNodeModules(); + config.resolver.hasteImplModulePath = config.resolver.hasteImplModulePath || defaultConfig.hasteImplModulePath; + config.resolver.platforms = config.resolver.platforms || defaultConfig.getPlatforms(); + config.resolver.providesModuleNodeModules = config.resolver.providesModuleNodeModules || defaultConfig.getProvidesModuleNodeModules(); return {...defaultRNConfig, ...config}; }