@@ -7,8 +7,12 @@ const workspaceRoot = path.resolve(projectRoot, "../..");
77
88const config = getDefaultConfig ( projectRoot ) ;
99
10- // Watch entire monorepo for hot reload
11- config . watchFolders = [ workspaceRoot ] ;
10+ // Watch only relevant directories for hot reload (not entire monorepo)
11+ // This avoids watching Rust target/ dirs (4.5GB+) and other build artifacts
12+ config . watchFolders = [
13+ path . resolve ( projectRoot , "src" ) ,
14+ path . resolve ( workspaceRoot , "packages" ) ,
15+ ] ;
1216
1317// Configure resolver for monorepo and SVG support
1418config . resolver = {
@@ -25,17 +29,18 @@ config.resolver = {
2529 path . resolve ( workspaceRoot , "node_modules" ) ,
2630 ] ,
2731
28- // Exclude build outputs and prevent loading wrong React version from root
32+ // Exclude build outputs
2933 blockList : [
3034 / \/ a p p s \/ m o b i l e \/ i o s \/ b u i l d \/ .* / ,
3135 / \/ a p p s \/ m o b i l e \/ a n d r o i d \/ b u i l d \/ .* / ,
32- // Block React from workspace root to force local version
33- new RegExp ( `^${ workspaceRoot } /node_modules/react/.*` ) ,
3436 ] ,
3537
36- // Force React resolution from mobile app's node_modules
38+ // Dynamically resolve React/React Native from wherever the package manager installed them
3739 extraNodeModules : {
38- react : path . resolve ( projectRoot , "node_modules/react" ) ,
40+ react : path . dirname ( require . resolve ( "react/package.json" , { paths : [ projectRoot , workspaceRoot ] } ) ) ,
41+ "react-native" : path . dirname (
42+ require . resolve ( "react-native/package.json" , { paths : [ projectRoot , workspaceRoot ] } )
43+ ) ,
3944 } ,
4045} ;
4146
0 commit comments