react-native-webpack-starter-kit
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
- Node 4.x or better
- Xcode for iOS development
- Android SDK for Android development
- Android Lollipop or better for Android device testing
Stack
- React Native for native app development
- Babel for ES6+ support
- Webpack module loader and bundler
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.
- Execute
npm run bundle
to generate the offline JS bundle. - For iOS, update
AppDelegate.m
to load from pre-bundled file on disk. - 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.