From 140b230e84f2a5aecdacbcd8527bef370460464d Mon Sep 17 00:00:00 2001 From: Ives van Hoorne Date: Thu, 2 Aug 2018 05:22:57 -0700 Subject: [PATCH] Change react-native config loading to provide an override for the default config. Summary: Instead of overriding the config at the end we now do it right after applying default config and before the user config is applied. Reviewed By: rafeca Differential Revision: D9131758 fbshipit-source-id: 15e575fc11a781187f3ee2fa7cf81c227cf6a088 --- local-cli/util/Config.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/local-cli/util/Config.js b/local-cli/util/Config.js index 2222b9bcc50869..b55b061ec4cb37 100644 --- a/local-cli/util/Config.js +++ b/local-cli/util/Config.js @@ -14,7 +14,7 @@ const getPolyfills = require('../../rn-get-polyfills'); const path = require('path'); const {createBlacklist} = require('metro'); -const {loadConfig, mergeConfig} = require('metro-config'); +const {loadConfig} = require('metro-config'); /** * Configuration file of the CLI. @@ -85,11 +85,10 @@ const Config = { getProjectRoots, async load(configFile: ?string): Promise { - const config: ConfigT = await loadConfig( + return await loadConfig( configFile ? {config: configFile} : {}, + this.DEFAULT, ); - - return mergeConfig(config, this.DEFAULT); }, };