Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/m-abs/nativescript-app-environment
https://github.com/m-abs/nativescript-app-environment
environment-variables nativescript nativescript-hook
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/m-abs/nativescript-app-environment
- Owner: m-abs
- Created: 2018-05-25T12:52:04.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-25T13:42:21.000Z (over 6 years ago)
- Last Synced: 2024-10-01T14:31:24.380Z (4 months ago)
- Topics: environment-variables, nativescript, nativescript-hook
- Language: TypeScript
- Size: 6.84 KB
- Stars: 6
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```bash
tns plugin add nativescript-app-environment
```### Usage
* Set production mode in tns run:
```bash
tns run android --env.app.prod
```This will create `environment.json` with this content:
```typescript
{ prod: true }
```* in app
```typescript
const { environment } = require('./environment.json');console.log(environment);
```* Inspired by [nativescript-hook-debug-production](https://github.com/markosko/nativescript-hook-debug-production)