File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 11const { getDefaultConfig } = require ( "expo/metro-config" ) ;
22const { 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
624module . exports = withNativeWind ( config , { input : "./global.css" } ) ;
You can’t perform that action at this time.
0 commit comments