Skip to content

Commit

Permalink
Change react-native config loading to provide an override for the def…
Browse files Browse the repository at this point in the history
…ault 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
  • Loading branch information
Ives van Hoorne authored and facebook-github-bot committed Aug 2, 2018
1 parent b911848 commit 140b230
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions local-cli/util/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -85,11 +85,10 @@ const Config = {
getProjectRoots,

async load(configFile: ?string): Promise<ConfigT> {
const config: ConfigT = await loadConfig(
return await loadConfig(
configFile ? {config: configFile} : {},
this.DEFAULT,
);

return mergeConfig(config, this.DEFAULT);
},
};

Expand Down

0 comments on commit 140b230

Please sign in to comment.