Skip to content

Commit

Permalink
Do not override metro.config.js settings (facebook#20705)
Browse files Browse the repository at this point in the history
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: facebook#20705

Differential Revision: D9390146

Pulled By: hramos

fbshipit-source-id: 5ccc137490410ace72d7b0e68f2bafcbb233c59f
  • Loading branch information
rozele authored and aleclarson committed Sep 16, 2018
1 parent 2249cfe commit 028702e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions local-cli/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ async function getCliConfig(): Promise<RNConfig> {
);

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};
}
Expand Down

0 comments on commit 028702e

Please sign in to comment.