Skip to content

Commit 1ef91b5

Browse files
committed
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.
1 parent f3db6cc commit 1ef91b5

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

scripts/react_native_pods.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
require_relative './cocoapods/utils.rb'
1515
require_relative './cocoapods/new_architecture.rb'
1616
require_relative './cocoapods/local_podspec_patch.rb'
17+
require_relative '../../@react-native-community/cli-platform-ios/native_modules'
1718

1819
$CODEGEN_OUTPUT_DIR = 'build/generated/ios'
1920
$CODEGEN_COMPONENT_DIR = 'react/renderer/components'

template/ios/Podfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require_relative '../node_modules/react-native/scripts/react_native_pods'
2-
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
32

43
platform :ios, '12.4'
54
install! 'cocoapods', :deterministic_uuids => false

0 commit comments

Comments
 (0)