Skip to content

Commit

Permalink
metro
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Sep 26, 2024
1 parent f09ee24 commit 60cb301
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions example2/metro.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require('expo/metro-config')
const path = require('path')

const config = getDefaultConfig(__dirname)
// const extraNodeModules = require('node-libs-browser')
// config.resolver.extraNodeModules = extraNodeModules
// npm v7+ will install ../node_modules/react-native because of peerDependencies.
// To prevent the incompatible react-native bewtween ./node_modules/react-native and ../node_modules/react-native,
// excludes the one from the parent folder when bundling.
config.resolver.blockList = [
...Array.from(config.resolver.blockList ?? []),
new RegExp(path.resolve('..', 'node_modules', 'react-native')),
]

config.resolver.nodeModulesPaths = [
path.resolve(__dirname, './node_modules'),
path.resolve(__dirname, '../node_modules'),
]

config.resolver.extraNodeModules = {
'xmtp-react-native-sdk': '..'
}

config.watchFolders = [path.resolve(__dirname, '..')]

config.transformer.getTransformOptions = async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
})

module.exports = config

0 comments on commit 60cb301

Please sign in to comment.