From 8d2f1e7c31a07e2a78e70bd1ab7995e824dcff10 Mon Sep 17 00:00:00 2001 From: Eli Zibin <1131641+zibs@users.noreply.github.com> Date: Wed, 24 Jul 2024 11:24:39 -0700 Subject: [PATCH] fix metro for example app for iOS (#1005) --- examples/demo/metro.config.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/demo/metro.config.js b/examples/demo/metro.config.js index 080d7831..a0f7bf42 100644 --- a/examples/demo/metro.config.js +++ b/examples/demo/metro.config.js @@ -6,10 +6,13 @@ const packagePath = path.resolve( path.join(process.cwd(), '..', '..', 'packages', 'react-native-app-auth'), ); +const projectRoot = __dirname; +const monorepoRoot = path.resolve(projectRoot, '../..'); + const extraNodeModules = { 'react-native-app-auth': packagePath, }; -const watchFolders = [packagePath]; +const watchFolders = [monorepoRoot, packagePath]; /** * Metro configuration @@ -30,4 +33,9 @@ const config = { watchFolders, }; +config.resolver.nodeModulesPaths = [ + path.resolve(projectRoot, 'node_modules'), + path.resolve(monorepoRoot, 'node_modules'), +]; + module.exports = mergeConfig(getDefaultConfig(__dirname), config);