/react-native-webpack-starter-kit

A minimalist boilerplate for starting React Native apps with Webpack and ES6 using Babel.

Primary LanguageObjective-CMIT LicenseMIT

react-native-webpack-starter-kit

Dependency Status devDependency Status

A minimalist seed for building with React Native and Webpack. Leverages react-native-webpack-server. Similar to the RNWS BabelES6 project. Follows the latest React Native stable release. For a list of awesome starter kits for React Native please visit Awesome React Boilerplates.

For an example implementation check out Lumpen Radio.

Requirements

Stack

Installation

Start by cloning this repo and installing dependencies:

git clone https://github.com/jhabdas/react-native-webpack-starter-kit.git
cd react-native-webpack-starter-kit
npm install # Install Node.js dependencies listed in ./package.json

Running

Once dependencies are installed, start the application with:

npm start # or: node node_modules/.bin/rnws

This will start a Webpack Dev Server which will watch your JS files for changes and automatically generate the index.[platform].js file expected by your React Native iOS or Android app.

iOS

Open ios/App.xcodeproj in Xcode, build and run the project.

Android

For android development use the following:

npm run android-setup-port
react-native run-android

Note Android support in React Native is relatively new, so expect some hiccups. Please see the official Android Setup documentation for getting set-up and additional information. And here's some helpful npm scripts courtesy of @niftylettuce.

If you run into any issues please see the Getting Started guide for React Native before submitting an issue.

Bundling

Building the app for distribution.

  1. Execute npm run bundle to generate the offline JS bundle.
  2. For iOS, update AppDelegate.m to load from pre-bundled file on disk.
  3. Test the application, create an archive and submit to the store.

Submitting to App Store

Please see Submitting to App Store. If you'd like help getting your app in the store I'm available for booking on Codementor.