npm i --save nativescript-app-environment
- Version: 1.0.0
- GitHub: https://github.com/m-abs/nativescript-app-environment
- NPM: https://www.npmjs.com/package/nativescript-app-environment
- Downloads:
- Last Day: 0
- Last Week: 0
- Last Month: 0
nativescript-app-environment
Add environment variables into your app from the nativescript-cli
Creates app/environment.json
from the nativescript-cli command via argv --env.app
Install
tns plugin add nativescript-app-environment
Usage
-
Set production mode in tns run:
tns run android --env.app.prod
This will create
environment.json
with this content:{ prod: true }
-
in app
const { environment } = require('./environment.json');
console.log(environment); -
Inspired by nativescript-hook-debug-production