Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danielmark0116/rn-web-monorepo
https://github.com/danielmark0116/rn-web-monorepo
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/danielmark0116/rn-web-monorepo
- Owner: danielmark0116
- Created: 2020-04-14T21:12:53.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T03:26:17.000Z (almost 2 years ago)
- Last Synced: 2023-03-05T16:17:33.483Z (over 1 year ago)
- Language: Java
- Size: 7.42 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RN WEB monorepo
## STEP 1
1. After initializing the project with `react-native init` format the root dir structure (to use yarn workspaces -> split into mobile web and components)
2. Move everything except `.git` to mobile part of the dir
2a. Rename `name` in package.json in mobile to `mobile`
3. Make new package.json in root
4. Install RN in the root again (while also removing node_modules from mobile)
5. Find all and replace -> `node_modules/react-native/` into `../../node_modules/react-native/` (I had to also manualy fix one path in Pods)
6. Edit AppDelegate and metro.config.js as in here: https://dev.to/brunolemos/tutorial-100-code-sharing-between-ios-android--web-using-react-native-web-andmonorepo-4pej
7. You can run the mobil commands form the root with prefixing it with `yarn workspace mobile` (e.g. for metro `yarn workspace mobile start` and for simulator `yarn workspace mobile ios --simulator="NAME"`)
> for IOS manual path fix in Pods for `node_modules/@react-native-community`
## Step 2 - Android changes
manual path fix in `android/app/build.gradle` and `android/settings.gradle` -> relative paths for `node_modules/@react-native-community`
```
apply from: file("../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
```