Socket
Socket
Sign inDemoInstall

nativescript-dev-multiple-env

Package Overview
Dependencies
0
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nativescript-dev-multiple-env

A Hook For Nativescript to allow multiple Environments


Version published
Weekly downloads
39
increased by3800%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

nativescript-dev-multiple-environments

This Hook is made for using multiple environments within a nativescript application.

What it does

First it changes your packageId to whatever you have stated in your environment-rules.json

it also copies any files you have suffixed with the name of the environemnt for example : App_Resources/Android/google-services.staging.json will get copied to App_Resources/Android/google-services.json before building.

Selecting Environment

Once you have a initial environment-rules.json file you can change between the environments using --env.use.ENV_NAME

for example for ios: tns run ios --env.use.staging

this can also be used with other --env args like:

tns run ios --bundle --env.aot --env.uglify --env.use.release

Environments

a basic environment-rules.json file is generated for you it looks like this:


{
    "version": "1.0.0",
    "default": "staging",
    "extraPaths": [
        'app/environments'
    ],
    "environments": [
        {
            name: "staging",
            packageId: "org.nativescript.appName.staging",
            copyRule: "(.*\\.staging\\..*)"
        },
        {
            name: "release",
            packageId: "org.nativescript.appName.release",
            copyRule: "(.*\\.release\\..*)"
        }
    ]
}

You can tweak this however you want, and add as many environments as you like.

ExtraPaths is Optional, but can add multiple paths within the app. these will follow the same rules for the rules.

FAQs

Last updated on 15 Aug 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc