mirror of
https://github.com/status-im/metro.git
synced 2025-03-03 12:10:30 +00:00
[ReactNative] Adjust packager default root when running from within node_modules
This commit is contained in:
parent
98ed9422c2
commit
601b21fa79
@ -37,9 +37,14 @@ if (options.projectRoots) {
|
|||||||
if (!Array.isArray(options.projectRoots)) {
|
if (!Array.isArray(options.projectRoots)) {
|
||||||
options.projectRoots = options.projectRoots.split(',');
|
options.projectRoots = options.projectRoots.split(',');
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (__dirname.match(/node_modules\/react-native\/packager$/)) {
|
||||||
|
// packager is running from node_modules of another project
|
||||||
|
options.projectRoots = [path.resolve(__dirname, '../../..')];
|
||||||
} else {
|
} else {
|
||||||
options.projectRoots = [path.resolve(__dirname, '..')];
|
options.projectRoots = [path.resolve(__dirname, '..')];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (options.root) {
|
if (options.root) {
|
||||||
if (typeof options.root === 'string') {
|
if (typeof options.root === 'string') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user