Skip to content

A boilerplate for a cordova project with react, perfect starting point for your hybrid mobile development.

Notifications You must be signed in to change notification settings

sanonz/cordova-react-webpack-starter

Repository files navigation

cordova-react-webpack-starter

Cordova 打包 HTML5 为 APP,基于 cordova、webpack、react 构建的模版,是您移动 APP 开发的完美起点。

安装

$ git clone https://github.com/sanonz/cordova-react-webpack-starter.git
$ cd cordova-react-webpack-starter
$ npm install

Cordova 环境搭建详细教程请移步:使用 Phonegap + Cordova 搭建混合开发平台

配置说明

全局配置文件:config.json

{
  "local": {
    "api": "//api-dev.newbox.ltd/"
  },
  "staging": {
    "api": "//api-dev.newbox.ltd/"
  },
  "production": {
    "api": "//api-dev.newbox.ltd/"
  }
}
  • {env} 环境配置
  • {env}.api 接口地址

开发启动

先启动 webpack

$ npm run dev:local
$ npm run dev:staging
$ npm run dev:production

再启动 phonegap

$ npm run serve

然后再 phonegap 应用中输入调试 IP 地址

编译发布

编译 debug 版本

$ npm run debug:{platform}:local
$ npm run debug:{platform}:staging
$ npm run debug:{platform}:production

编译 release 版本

$ npm run release:{platform}:local
$ npm run release:{platform}:staging
$ npm run release:{platform}:production

About

A boilerplate for a cordova project with react, perfect starting point for your hybrid mobile development.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published