Support scripts for ngX-Rocket projects.
In order to simplify the workflow of applications generated with ngX-Rocket generator, we made this repo to gather all additional scripts and build tools.
Since this module is an independant package, you can even use for projects not built from ngX-Rocket if you find it useful.
npm install --save @ngx-rocket/scripts
This modules provides CLI commands to be used in NPM scripts, along with some
Cordova hooks (see hooks
folder).
ngx-scripts env <env_var> [<env_var2> ...] [--out <file>] [--format json|js] [--parse-json]
Default output file is src/environments/.env.ts
with JavaScript format.
ngx-scripts cordova <command> [options] [-- <cordova_options>]
Unless the --fast
option is provided, the Angular app is rebuilt before executing the command, using npm run build
.
Any accepted Cordova option can be passed through after --
.
--app
: The name of the Angular app to build. Only useful if you have a workspace with multiples apps.--fast
: Skip Angular app rebuild--base-href <ref>
: Change application base URL (default is./
)--copy <path>
: Copy built apps to the specified path (only works withcordova build
)--dev
: Build Angular app indev
mode (default isprod
)-c, --configuration <name>
: Target Angular CLI configuration fornpm run build
--device
: Deploy Cordova build to a device--emulate
: Deploy Cordova build to an emulator--debug
: Create a Cordova debug build--release
: Create a Cordova release build--verbose
: Show Cordova debug output--yarn
: Use Yarn instead of NPM to run thebuild
script--parse-json
: Duringenv
, if an environment variable's value is parsable JSON, it will be a proper object in.env.ts
Note: Yarn is automatically used instead of NPM if the environment variable
NGX_PACKAGE_MANAGER
is set toyarn
or if the current project was generated with ngX-Rocket using Yarn option (option is saved in.yo-rc.json
).
ngx-scripts cordova prepare
ngx-scripts cordova run ios --dev --debug --emulate
ngx-scripts cordova build ios --configuration production --device --release -- --developmentTeam="ABCD" --provisioningProfile="UUID"
clean [--cordova] [--dist] [--path <path>]
--cordova
: Remove only Cordova folders--dist
: Remove only dist folder--path <path>
: Remove only specified path