1// Learn more https://docs.expo.io/guides/customizing-metro 2const { getDefaultConfig } = require('expo/metro-config'); 3const path = require('path'); 4 5const config = getDefaultConfig(__dirname); 6 7// npm v7+ will install ../node_modules/react-native because of peerDependencies. 8// To prevent the incompatible react-native bewtween ./node_modules/react-native and ../node_modules/react-native, 9// excludes the one from the parent folder when bundling. 10config.resolver.blockList = [ 11 ...Array.from(config.resolver.blockList ?? []), 12 new RegExp(path.resolve('..', 'node_modules', 'react-native')), 13]; 14 15config.resolver.nodeModulesPaths = [ 16 path.resolve(__dirname, './node_modules'), 17 path.resolve(__dirname, '../node_modules'), 18]; 19 20config.watchFolders = [path.resolve(__dirname, '..')]; 21 22config.transformer.getTransformOptions = async () => ({ 23 transform: { 24 experimentalImportSupport: false, 25 inlineRequires: true, 26 }, 27}); 28 29module.exports = config;