Skip to content

Commit 43f5aa8

Browse files
committed
prevent picking up electron react
1 parent 2f243d5 commit 43f5aa8

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

apps/mobile/metro.config.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
const { getDefaultConfig } = require("expo/metro-config");
22
const { withNativeWind } = require("nativewind/metro");
3+
const path = require("path");
34

4-
const config = getDefaultConfig(__dirname);
5+
const projectRoot = __dirname;
6+
const monorepoRoot = path.resolve(projectRoot, "../..");
7+
8+
const config = getDefaultConfig(projectRoot);
9+
10+
// Watch monorepo root for changes
11+
config.watchFolders = [monorepoRoot];
12+
13+
// Let Metro find modules in both locations
14+
config.resolver.nodeModulesPaths = [
15+
path.resolve(projectRoot, "node_modules"),
16+
path.resolve(monorepoRoot, "node_modules"),
17+
];
18+
19+
// Force React to resolve from monorepo root
20+
config.resolver.extraNodeModules = {
21+
react: path.resolve(monorepoRoot, "node_modules/react"),
22+
};
523

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

0 commit comments

Comments
 (0)