@@ -5,44 +5,16 @@ const { withNativeWind } = require("nativewind/metro");
5
5
const path = require ( "node:path" ) ;
6
6
7
7
const config = withTurborepoManagedCache (
8
- withMonorepoPaths (
9
- withNativeWind ( getDefaultConfig ( __dirname ) , {
10
- input : "./global.css" ,
11
- configPath : "./tailwind.config.js" ,
12
- } ) ,
13
- ) ,
8
+ withNativeWind ( getDefaultConfig ( __dirname ) , {
9
+ input : "./global.css" ,
10
+ configPath : "./tailwind.config.js" ,
11
+ } ) ,
14
12
) ;
15
13
16
14
config . resolver . unstable_enablePackageExports = true ;
17
15
18
- config . resolver . disableHierarchicalLookup = true ;
19
-
20
16
module . exports = config ;
21
17
22
- /**
23
- * Add the monorepo paths to the Metro config.
24
- * This allows Metro to resolve modules from the monorepo.
25
- *
26
- * @see https://docs.expo.dev/guides/monorepos/#modify-the-metro-config
27
- * @param {import('expo/metro-config').MetroConfig } config
28
- * @returns {import('expo/metro-config').MetroConfig }
29
- */
30
- function withMonorepoPaths ( config ) {
31
- const projectRoot = __dirname ;
32
- const workspaceRoot = path . resolve ( projectRoot , "../.." ) ;
33
-
34
- // #1 - Watch all files in the monorepo
35
- config . watchFolders = [ workspaceRoot ] ;
36
-
37
- // #2 - Resolve modules within the project's `node_modules` first, then all monorepo modules
38
- config . resolver . nodeModulesPaths = [
39
- path . resolve ( projectRoot , "node_modules" ) ,
40
- path . resolve ( workspaceRoot , "node_modules" ) ,
41
- ] ;
42
-
43
- return config ;
44
- }
45
-
46
18
/**
47
19
* Move the Metro cache to the `.cache/metro` folder.
48
20
* If you have any environment variables, you can configure Turborepo to invalidate it when needed.
0 commit comments