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