From 1ef91b56de5b65ae33493b922373734f5e9ca539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danilo=20B=C3=BCrger?= Date: Mon, 18 Jul 2022 20:51:05 +0200 Subject: [PATCH] Move cocoapods cli native_modules require from template to rn scripts This resolves issues where the node_modules structure is not hoisted (like with pnpm). Since the template does not directly depend on the cli, it doesn't exist in the pnpm node_modules root. Moving it to the rn scripts makes sure that the relative require starts in the correct directory for both hoisted and pnpm structures. --- scripts/react_native_pods.rb | 1 + template/ios/Podfile | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 3d86c4f3de4e3d..a6e4b7b858196c 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -14,6 +14,7 @@ require_relative './cocoapods/utils.rb' require_relative './cocoapods/new_architecture.rb' require_relative './cocoapods/local_podspec_patch.rb' +require_relative '../../@react-native-community/cli-platform-ios/native_modules' $CODEGEN_OUTPUT_DIR = 'build/generated/ios' $CODEGEN_COMPONENT_DIR = 'react/renderer/components' diff --git a/template/ios/Podfile b/template/ios/Podfile index 92e7ee1919e671..73e080f96ccabc 100644 --- a/template/ios/Podfile +++ b/template/ios/Podfile @@ -1,5 +1,4 @@ require_relative '../node_modules/react-native/scripts/react_native_pods' -require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' platform :ios, '12.4' install! 'cocoapods', :deterministic_uuids => false