mirror of https://github.com/status-im/metro.git
[ReactNative] Adjust packager default root when running from within node_modules
This commit is contained in:
parent
98ed9422c2
commit
601b21fa79
|
@ -38,7 +38,12 @@ if (options.projectRoots) {
|
|||
options.projectRoots = options.projectRoots.split(',');
|
||||
}
|
||||
} else {
|
||||
options.projectRoots = [path.resolve(__dirname, '..')];
|
||||
if (__dirname.match(/node_modules\/react-native\/packager$/)) {
|
||||
// packager is running from node_modules of another project
|
||||
options.projectRoots = [path.resolve(__dirname, '../../..')];
|
||||
} else {
|
||||
options.projectRoots = [path.resolve(__dirname, '..')];
|
||||
}
|
||||
}
|
||||
|
||||
if (options.root) {
|
||||
|
|
Loading…
Reference in New Issue