This repo is a practical implementation of ideas, discussed in the Medium article, about creating a multi-branding app from a single source code file using gulp
# Clone the repo
git clone https://github.com/jerinjohnk/rnmultibrand.git
# Install dependencies
1) rnproject open a terminal
yarn
2) rnmultibrand(root) open a terminal
npm install gulp
These steps are used to run the first flavor app1.
# Open Gulpfile.js change app flavor value
var appFlavor = "app1";
# Root folder terminal run
gulp start
# Run the app
react-native run-ios
or
react-native run-android
First creates an src folder -> copies main folder content -> overrides with selected app flavor -> starts a watcher that watches selected app folder for any changes. If a file changes, it starts the overwrite task.
# Open Gulpfile.js change appflavor value
var appFlavor = "app2";
# Close watcher if it's running
# Root folder terminal run
gulp start
Try out changing any style, value etc present in the app folder for which watcher is running u will find the app updates during hot reload or on reload.
This repo is a step towards creating multi-branding app in React Native. Right now have used gulp to automate this process. Would improve the scripts and build process further once I have successfully implemented them. Any suggestions for the same would be greatly appreciated.
If there are any other ideas presented in this repo, that you think worth mentioning - feel free open a pull request :)