Skip to content

Commit 4e7898c

Browse files
fix: configure Metro for monorepo local development in expo-example
Without watchFolders, nodeModulesPaths, and blockList, Metro cannot resolve the symlinked @intercom/intercom-react-native package when developing locally from examples/expo-example. This caused a cascade of errors: unresolved modules, duplicate React Native copies, and SyntaxError from stale dependencies in the library root's node_modules. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent dc89f30 commit 4e7898c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
const path = require('path');
12
const { getDefaultConfig } = require('expo/metro-config');
23
const { withNativeWind } = require('nativewind/metro');
34

5+
const libraryRoot = path.resolve(__dirname, '..', '..');
6+
47
const config = getDefaultConfig(__dirname);
58
config.resolver.unstable_enableSymlinks = true;
9+
config.watchFolders = [libraryRoot];
10+
config.resolver.nodeModulesPaths = [
11+
path.resolve(__dirname, 'node_modules'),
12+
];
13+
config.resolver.blockList = [
14+
new RegExp(path.resolve(libraryRoot, 'node_modules') + '/.*'),
15+
];
616

717
module.exports = withNativeWind(config, { input: './global.css' });

0 commit comments

Comments
 (0)