Skip to content

Commit

Permalink
Move cocoapods cli native_modules require from template to rn scripts
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
danilobuerger committed Jul 18, 2022
1 parent f3db6cc commit 1ef91b5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 0 additions & 1 deletion template/ios/Podfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 1ef91b5

Please sign in to comment.