@@ -15,8 +15,17 @@ const blacklist = require('./blacklist');
1515const path = require ( 'path' ) ;
1616
1717module . exports = {
18- getProjectRoots ( ) {
19- return this . _getRoots ( ) ;
18+ getProjectRoot ( ) {
19+ // Match on either path separator
20+ if ( __dirname . match ( / n o d e _ m o d u l e s [ \/ \\ ] m e t r o ( - b u n d l e r ) ? $ / ) ) {
21+ // Metro Bundler is running from node_modules of another project
22+ return path . resolve ( __dirname , '../../..' ) ;
23+ } else if ( __dirname . match ( / P o d s \/ R e a c t \/ p a c k a g e r $ / ) ) {
24+ // Metro Bundler is running from node_modules of another project
25+ return path . resolve ( __dirname , '../../..' ) ;
26+ } else {
27+ return path . resolve ( __dirname , '..' ) ;
28+ }
2029 } ,
2130
2231 getAssetExts ( ) {
@@ -31,19 +40,6 @@ module.exports = {
3140 return blacklist ( ) ;
3241 } ,
3342
34- _getRoots ( ) {
35- // match on either path separator
36- if ( __dirname . match ( / n o d e _ m o d u l e s [ \/ \\ ] m e t r o ( - b u n d l e r ) ? $ / ) ) {
37- // Metro Bundler is running from node_modules of another project
38- return [ path . resolve ( __dirname , '../../..' ) ] ;
39- } else if ( __dirname . match ( / P o d s \/ R e a c t \/ p a c k a g e r $ / ) ) {
40- // Metro Bundler is running from node_modules of another project
41- return [ path . resolve ( __dirname , '../../..' ) ] ;
42- } else {
43- return [ path . resolve ( __dirname , '..' ) ] ;
44- }
45- } ,
46-
4743 getTransformModulePath ( ) {
4844 return require . resolve ( './reactNativeTransformer' ) ;
4945 } ,
0 commit comments