mirror of https://github.com/status-im/metro.git
Added support for React installed in the application via Cocoapods
Summary: Similarly to npm-installed react, this change makes changes to the packager so that it understands that it's been installed via Cocoapods and determines the project and asset roots properly (from the main application directory). Closes https://github.com/facebook/react-native/pull/1568 Github Author: Jarek Potiuk <jarek@potiuk.com> Test Plan: Imported from GitHub, without a `Test Plan:` line.
This commit is contained in:
parent
050f0b3558
commit
23ac061d83
|
@ -66,6 +66,9 @@ if (options.projectRoots) {
|
|||
if (__dirname.match(/node_modules\/react-native\/packager$/)) {
|
||||
// packager is running from node_modules of another project
|
||||
options.projectRoots = [path.resolve(__dirname, '../../..')];
|
||||
} else if (__dirname.match(/Pods\/React\/packager$/)) {
|
||||
// packager is running from node_modules of another project
|
||||
options.projectRoots = [path.resolve(__dirname, '../../..')];
|
||||
} else {
|
||||
options.projectRoots = [path.resolve(__dirname, '..')];
|
||||
}
|
||||
|
@ -88,6 +91,8 @@ if (options.assetRoots) {
|
|||
} else {
|
||||
if (__dirname.match(/node_modules\/react-native\/packager$/)) {
|
||||
options.assetRoots = [path.resolve(__dirname, '../../..')];
|
||||
} else if (__dirname.match(/Pods\/React\/packager$/)) {
|
||||
options.assetRoots = [path.resolve(__dirname, '../../..')];
|
||||
} else {
|
||||
options.assetRoots = [path.resolve(__dirname, '..')];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue