1.0.1 • Published 7 years ago

react-native-coffee v1.0.1

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

react-native-coffee

Setup

  1. Install dependencies via npm:

    npm i --save-dev gulp react-native-coffee
  2. Create a Gulpfile.coffee

    gulp = require 'gulp'
    require 'react-native-coffee'
    
    gulp.task 'default', ['watch']
  3. Delete index.ios.js

  4. Create index.ios.coffee. Put your app in there.

  5. Run gulp to bootstrap your compilation.

  6. From now on, after you run react-native run-ios, run gulp. Coffeescript should ensue each time you make a change to your .coffee files.

Why

Most approaches to adding Coffeescript to React Native require you to do some kind of boilerplate setup where you clone someone's project and then make your modifications to that.

This approach has some drawbacks, including:

  • clunky to change lots of minor things that the boilerplate includes (source control bindings, authors, project names)
  • difficult to update/upgrade as upstream dependencies change

This package makes it a litle simpler to add turnkey coffeescript compilation to a React Native project, assuming you don't want to modify the build process much.

Thanks to ReactNativeCoffee for inspiration/code samples

Todo

  • Add support for Android