React + Babel + Browserify = React Native

NPM Modules

Yes you need all of these

npm install --save react react-dom babelify babel-preset-react babel-preset-es2015 browserify watchify  

Run the above command in the root of your project directory. You may be thinking that you should install the npm_modules in your www or app subdirectory. But trust me you shouldn't.

Build & Watch

One time build

browserify -t [ babelify --presets [ react es2015 ] ] app/scripts/_index.js -o app/scripts/index.js  

Same command using Watchify

watchify -t [ babelify --presets [ react es2015 ] ] app/scripts/_index.js -o app/scripts/index.js  

Include

index.html

<script src="scripts/index.js"></script>  

Then all you need to do is include the output script in your index.html. The watchify command will take care of compiling the ES2015 with Babel, compiling the JSX if any, injecting React, and pulling in all the required components into that one file.

Resources