CLI Setup
Installing LiveBundle CLI
We recommend keeping the CLI local to your React Native application project, and not installing it globally.
To add a dependency on the CLI your can run the following command from your application directory:
- npm
- Yarn
npm install --save livebundle
yarn add livebundle
If you are using npm
as your package manager, you will also need to add the following in the scripts
section of your application package.json
:
"livebundle": "livebundle"
Creating a LiveBundle configuration file
To create an initial LiveBundle configuration file for your application, just run the init
command from your application project directory
- npm
- Yarn
npm run livebundle init
yarn run livebundle init
The init
command will generate a new livebundle.yml
configuration file in your React Native application directory.
This configuration file will work out of the box, but is configured to use the livebundle-storage-fs storage plugin to store the bundles. This means that the bundles will be stored in a local directory ([HOME]/.livebundle/storage
).
Trying the CLI
To try out LiveBundle upload, just run the following command:
- npm
- Yarn
npm run livebundle upload
yarn run livebundle upload
The default configuration file will inform LiveBundle to generate two dev bundle (android/ios) and store them in [HOME]/.livebundle/storage
, along with generating QR Code and Deep Link representations. It will then surface these representations in the terminal and in an image viewer (for the QR Code).
Now that we're done with the CLI, it is time to add and initialize the native module.