File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
react-native-node-api-cmake/src
react-native-node-api-modules/src/bindings-polyfill Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -128,11 +128,11 @@ export function createFramework(libraryPath: string) {
128128 const newLibraryPath = path . join ( frameworkPath , libraryName ) ;
129129 fs . renameSync ( libraryPath , newLibraryPath ) ;
130130 // Update the name of the library
131- // cp.spawnSync("install_name_tool", [
132- // "-id",
133- // `@rpath/${libraryName}`,
134- // newLibraryPath,
135- // ]);
131+ cp . spawnSync ( "install_name_tool" , [
132+ "-id" ,
133+ `@rpath/ ${ libraryName } .framework /${ libraryName } ` ,
134+ newLibraryPath ,
135+ ] ) ;
136136 return frameworkPath ;
137137}
138138
@@ -161,6 +161,7 @@ export function createXCframework({
161161 ) ;
162162 assert . equal ( status , 0 , "Failed to create xcframework" ) ;
163163 // Write a file to mark the xcframework is a Node-API module
164+ // TODO: Consider including this in the Info.plist file instead
164165 fs . writeFileSync (
165166 path . join ( outputPath , "react-native-node-api-module" ) ,
166167 "" ,
Original file line number Diff line number Diff line change 11import { requireNodeAddon } from "../host" ;
22
33function binding ( moduleName : string ) : unknown {
4- return requireNodeAddon ( moduleName ) ;
4+ // Strip ".node" suffix
5+ moduleName = moduleName . replace ( / \. n o d e $ / g, "" ) ;
6+ return requireNodeAddon ( `@rpath/${ moduleName } .framework/${ moduleName } ` ) ;
57}
68
79export = binding ;
You can’t perform that action at this time.
0 commit comments