Skip to content
This repository has been archived by the owner on May 21, 2022. It is now read-only.

davidgerrard/cordova-react-typescript-webpack-boilerplate

Repository files navigation

Cordova-React-Typescript-Webpack Boilerplate

Introduction

This repository contains the basics of what you need to start developing a Cordova application, using React for the UI. You can build and run this on Android, and can add other platforms as you wish.

Getting Started

I am using versions 8.x of NodeJS and 5.x of NPM in my development environment. You may get an errors in your code compilation if you don't. You can use a tool called 'node version manager' if you want to keep older versions of node/npm installed, but have a play with this.

If you haven't a physical Android device, you can either run an emulator (lots of info on the web about doing this) or add your own device platform (cordova add [platform]).

  1. Clone this repo
  2. Install Cordova globally (npm install -g cordova)
  3. npm install
  4. npm run start:android

Developing For Android on Mac

If you want to build and run this project on a Mac, there are some additional steps you need to take to run on Android.

  1. Download the Android SDK Tools
  2. Run sdkmanager "platform-tools" "platforms;android-27" "build-tools;27.0.0" "tools" --verbose
  3. Add ANDROID_HOME="/PathToAndroidSDK" to your bash profile
  4. Install Gradle

Building

Webpack is used to build and compile the project. It runs through the linter before compiling the TypeScript. I have used Babel to get fully compatible JavaScript for Node. The output from Webpack (main.js and main.map.js) are published to the www/js folder.

To build the project run the command npm run build.

Linting

There is a tslint configuration included which extends StandardJS standards. Each time the project is built or started, the linter is run.

Testing

There is no testing currently added to this project. You can steal the basics from my other repo though.

Technologies Used

About

A basic boilerplate for creating Cordova applications, using React, Webpack and TypeScript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published