Skip to content

EdwinPalacios/ionic-boilerplate

Repository files navigation

Ionic Boilerplate Open Source Love

Currently this project is using the latest versions of all: Ionic and Angular 4

Setup

Requirements to use this project:

npm (Node Package Manager, it comes with node.js installation)

In case you're not with the latest version of npm:

sudo npm install npm -g
Cordova & Ionic Cli

To install both of them on your system just launch this command:

sudo npm install cordova ionic -g

Install NPM Dependencies

Once you clone this repository, run this command on your terminal to install all needed dependencies:

npm install

Install cordova plugin Dependencies

Run this command on your terminal to add a platform and install all needed puglins:

Android:

ionic cordova platform add android
ionic cordova run android

iOS:

ionic cordova platform add ios
ionic cordova run ios

Environment Variables

Create a default file src/environments/environment.ts which will be used for your PRODUCTION environment:

export const ENV = {
  mode: 'Production'
}

Create a default file src/environments/environment.dev.ts which will be used for your development environment:

export const ENV = {
  mode: 'Development'
}

You can then import your environment variables anywhere!

import { ENV } from '@app/env'

Launching the App

IONIC_ENV=prod ionic serve # to serve our project with prod env
IONIC_ENV=prod ionic cordova build android --prod # to build our android project with prod env 
ionic serve # to serve our project with dev env