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 862d59b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions scripts/native_modules.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

require_relative '../../@react-native-community/cli-platform-ios/native_modules'
2 changes: 1 addition & 1 deletion template/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/react-native/scripts/native_modules'

platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false
Expand Down

0 comments on commit 862d59b

Please sign in to comment.