目前,我在现有的 iOS 项目中实现了一个 ReactNative 模块。到目前为止,该项目运行良好,但构建时间显着增加,因为 xcode 每次构建都会重新编译每个 React 库。我尝试使用cocoapods-binary来预构建 React pod,但是,此插件不适用于本地 pod。
这是我的 Podfile:
platform :ios, "10.0"
plugin 'cocoapods-binary'
# Path to node_modules directory
$node_modules_path = "../../react-native-pojects/node_modules"
require_relative "#{$node_modules_path}/@react-native-community/cli-platform-ios/native_modules"
project "native-project",
"Debug" => :debug,
"Homolog" => :release,
"Release" => :release
target "native-project" do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# React Native pods
pod "FBLazyVector", :path => "#{$node_modules_path}/react-native/Libraries/FBLazyVector"
pod "FBReactNativeSpec", :path => "#{$node_modules_path}/react-native/Libraries/FBReactNativeSpec"
pod "RCTRequired", :path => "#{$node_modules_path}/react-native/Libraries/RCTRequired"
pod "RCTTypeSafety", …Run Code Online (Sandbox Code Playgroud) 当我按下后退按钮时,我需要调用一个函数.优选地,不必创建另一个按钮