Skip to content

Commit 862d59b

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 862d59b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

scripts/native_modules.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under the MIT license found in the
4+
# LICENSE file in the root directory of this source tree.
5+
6+
require_relative '../../@react-native-community/cli-platform-ios/native_modules'

template/ios/Podfile

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

44
platform :ios, '12.4'
55
install! 'cocoapods', :deterministic_uuids => false

0 commit comments

Comments
 (0)