Deploying a React App to Cordova

I’ve been building out a webapp using react. It’s completely responsive and developed in device mode.

Once I was happy with it’s behavior in browsers I decided it was time to port it as a native mobile app. Below we assume the whole application has been compiled with Browserify or Webpack into an app.js file. I’m also assuming es6 syntax and inline styles.

index.html

  • declare cordova.js before your bundle. This is automatically injected by Cordova at runtime.
  • declare a viewport meta tag to prevent resizing
  • declare a Content Security Policy. Read Cordova-plugin-whitelist.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s