You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-13Lines changed: 16 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -115,30 +115,33 @@ After having run the above commands, you can also open `Apps/Playground/ios/Play
115
115
116
116
### **Building the NPM Package**
117
117
118
-
An NPM package can be built in two different ways: as source, and as binaries. Source is useful if you want to debug the Babylon React Native source in the context of the project consuming it, though configuration is a bit more involved. Binaries are useful in that they simplify configuration in the consuming app, though they cannot be debugged so easily. The binary package is what is published to [npmjs.org](https://www.npmjs.com/package/@babylonjs/react-native).
118
+
If you want to test using a local build of the NPM package with your own React Native app, you can do so with a `gulp` command on a Mac (this requires a Mac as it builds binaries for both iOS and Android).
119
119
120
-
#### Source Package
120
+
```
121
+
cd Package
122
+
npm install
123
+
gulp pack
124
+
```
121
125
122
-
If you want to test using a local build of the source-based NPM package with your own React Native app, you can do so with the `npm pack` command on either Mac or Windows.
126
+
The NPM package will be built into the `Package` directory where the `gulp` command was run. Once the local NPM package has been built, it can be installed into a project using `npm`.
123
127
124
128
```
125
-
cd Apps/Playground/node_modules/@babylonjs/react-native
126
-
npm pack
129
+
cd <directory of your React Native app>
130
+
npm install <root directory of your BabylonReactNative clone>/Package/Assembled/babylonjs-react-native-0.0.1.tgz
127
131
```
128
132
129
-
This will produce a zipped local NPM source-based package that can be installed into a React Native application for testing purposes. Note that when testing a source based package for iOS, the XCode project needs to be generated with `CMake` as described [above](#ios).
133
+
### **Debugging in Context**
130
134
131
-
#### Binary Package
132
-
133
-
If you want to test using a local build of the binary-based NPM package with your own React Native app, you can do so with a `gulp` command on a Mac (this requires a Mac as it builds binaries for both iOS and Android).
135
+
If you want to consume `@babylonjs/react-native` as source in your React Native app (for debugging or for iterating on the code when making a contribution), you can install the package source directory as an npm package.
134
136
135
137
```
136
-
cd Package
137
-
npm install
138
-
gulp pack
138
+
cd <directory of your React Native app>
139
+
npm install <root directory of your BabylonReactNative clone>/Modules/@babylonjs/react-native
140
+
cd ios
141
+
pod install
139
142
```
140
143
141
-
This will produce a zipped local NPM binary-based package that can be installed into a React Native application for testing purposes.
144
+
This will create a symbolic link in your `node_modules` directory to the `@babylonjs/react-native` source directory. For iOS the XCode project needs to be generated with `CMake` as described [above](#ios) and added to your `xcworkspace`.
0 commit comments