Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore base config merge in metro-config #38092

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions packages/metro-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* @noformat
*/

/*:: import type {MetroConfig} from 'metro-config'; */
/*:: import type {ConfigT} from 'metro-config'; */

const {mergeConfig} = require('metro-config');
const {getDefaultConfig: getBaseConfig, mergeConfig} = require('metro-config');

const INTERNAL_CALLSITES_REGEX = new RegExp(
[
Expand All @@ -37,8 +37,8 @@ const INTERNAL_CALLSITES_REGEX = new RegExp(
*/
function getDefaultConfig(
projectRoot /*: string */
) /*: MetroConfig */ {
return {
) /*: ConfigT */ {
const config = {
resolver: {
resolverMainFields: ['react-native', 'browser', 'main'],
platforms: ['android', 'ios'],
Expand Down Expand Up @@ -76,6 +76,11 @@ function getDefaultConfig(
},
watchFolders: [],
};

return mergeConfig(
getBaseConfig.getDefaultValues(projectRoot),
config,
);
}

module.exports = {getDefaultConfig, mergeConfig};