Skip to content
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};