@@ -6,7 +6,7 @@ const escape = require('escape-string-regexp');
6
6
const blacklist = require ( 'metro-config/src/defaults/blacklist' ) ;
7
7
8
8
const root = path . resolve ( __dirname , '..' ) ;
9
- const packages = path . resolve ( __dirname , '..' , 'packages' ) ;
9
+ const packages = path . resolve ( root , 'packages' ) ;
10
10
11
11
// Get the list of dependencies for all packages in the monorepo
12
12
const modules = [ '@expo/vector-icons' ]
@@ -22,7 +22,7 @@ const modules = ['@expo/vector-icons']
22
22
) ;
23
23
24
24
// We need to collect list of deps that this package imports
25
- // Collecting both dependencies are peerDependencies sould do it
25
+ // Collecting both dependencies are peerDependencies should do it
26
26
return Object . keys ( {
27
27
...pak . dependencies ,
28
28
...pak . peerDependencies ,
@@ -59,19 +59,19 @@ module.exports = {
59
59
// When we import a package from the monorepo, metro won't be able to find their deps
60
60
// We need to specify them in `extraNodeModules` to tell metro where to find them
61
61
extraNodeModules : modules . reduce ( ( acc , name ) => {
62
- acc [ name ] = path . join ( __dirname , '..' , 'node_modules' , name ) ;
62
+ acc [ name ] = path . join ( root , 'node_modules' , name ) ;
63
63
return acc ;
64
64
} , { } ) ,
65
65
} ,
66
66
67
67
server : {
68
68
enhanceMiddleware : middleware => {
69
69
return ( req , res , next ) => {
70
+ // When an asset is imported outside the project root, it has wrong path on Android
71
+ // This happens for the back button in stack, so we fix the path to correct one
70
72
const assets = '/packages/stack/src/views/assets' ;
71
73
72
74
if ( req . url . startsWith ( assets ) ) {
73
- // When an asset is imported outside the project root, it has wrong path on Android
74
- // This happens for the back button in stack, so we fix the path to correct one
75
75
req . url = req . url . replace (
76
76
assets ,
77
77
'/assets/../packages/stack/src/views/assets'
0 commit comments