fix: Resolve node_modules/
better (#706)
* fix: Use `rootDir` instead of `projectDir` * Revert "fix: Use `rootDir` instead of `projectDir`" This reverts commit 058e0a110bcf9b688e12a1cccbac2f23a29fa55c. * fix: Find node_modules path where react-native/ lives * fix: Figure out VisionCameraExample project * Revert "fix: Figure out VisionCameraExample project" This reverts commit 7ca455098244dd62280d40586062803d1ccc2c5f.
This commit is contained in:
parent
1c09ded57e
commit
675dec5ab3
@ -7,9 +7,10 @@ static def findNodeModules(baseDir) {
|
||||
// Node's module resolution algorithm searches up to the root directory,
|
||||
// after which the base path will be null
|
||||
while (basePath) {
|
||||
def candidatePath = Paths.get(basePath.toString(), "node_modules")
|
||||
if (candidatePath.toFile().exists()) {
|
||||
return candidatePath.toString()
|
||||
def nodeModulesPath = Paths.get(basePath.toString(), "node_modules")
|
||||
def reactNativePath = Paths.get(nodeModulesPath.toString(), "react-native")
|
||||
if (nodeModulesPath.toFile().exists() && reactNativePath.toFile().exists()) {
|
||||
return nodeModulesPath.toString()
|
||||
}
|
||||
basePath = basePath.getParent()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user