Royale CLI
The NPM command-line interface tool
Royale CLI is a command-line tool that makes creating and compiling applications easier for users of NPM, the JavaScript package manager.
Installing Royale CLI
If you have not installed Apache Royale already, use this command in the command window:
npm install @apache-royale/royale-js -g
Then run:
npm install @apache-royale/cli -g
Working with Royale CLI
For information at any time about available commands and options, run:
royale help
Creating a new application
Navigate in the command window to the directory where you want to create the new application, called here my-royale-app
, then run:
royale new my-royale-app
This creates a new directory structure using the name of the application, and creates a basic app with one main MXML file: my-royale-app/src/Main.mxml
.
To review the app structure so far, navigate into the new direcctory:
cd my-royale-app
Running your application
Navigate in the command window into your application’s directory.
To compile and run in debug mode, run:
royale serve:debug
Royale:
- Compiles the project in debug mode, with a source map option.
- Starts a http server and serves the files from the
bin/js-debug
directory. - Opens the default browser and navigates to
http://localhost:3000
. - Listens to the
src
folder. When any file changes, Royale will recompile the app and reload the browser to show the updated application.
To compile and run in release mode, run:
royale serve:release
Royale:
- Compiles the project in release mode.
- Starts a http server and serves the files from the
bin/js-release
directory. - Opens the default browser and navigates to
http://localhost:3001
.