diff --git a/packages/metro-config/index.js b/packages/metro-config/index.js index e88df579040627..c43b46a34b8cf9 100644 --- a/packages/metro-config/index.js +++ b/packages/metro-config/index.js @@ -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( [ @@ -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'], @@ -76,6 +76,11 @@ function getDefaultConfig( }, watchFolders: [], }; + + return mergeConfig( + getBaseConfig.getDefaultValues(projectRoot), + config, + ); } module.exports = {getDefaultConfig, mergeConfig};