Usage
The CLI requires NodeJS >= 6.9.0 and NPM 3 or higher.
clea help
# or
clea help [command]
How to start ?
clea new <app-name> # Generate a new project
cd <app-name>
clea serve # Serve it
Go to http://localhost:8080/. Hot reload is active by default.
UI Framework
Pre-configure a default UI Framework:
clea new <app-name> --ui-framework <type>
Available types:
- material: for AngularJS Material
- bootstrap: for Angular UI Bootstrap
Make it Progressive
Generate the basics of a Progressive Web App with the following:
clea new <app-name> --make-it-progressive
Generated files:
- sw.conf.js: sw-precache and sw-toolbox configuration file.
- src/app/app.sw.ts: Service Worker registration.
- src/public/index.html: add metadata for PWA support.
- src/public/manifest.json: manifest file describing the application.
Serve
Change the host and port to listen to:
clea serve --port 4000 --host 0.0.0.0
Merge or override the webpack configuration:
# Merge with Clea webpack configuration
clea --merge-config webpack.config.js
# Override Clea webpack configuration
clea --override-config webpack.config.js
Mock your API
Easily mock a REST API with JSON Server:
clea serve --api
Options
--api [db] enable the mock API on the specified database JSON file (defaults to: db.json)
--api-custom-routes [config] add custom Express routes if you want something more than just a RESTFul API (defaults to: api.conf.js)
By using the --api option, a proxy is set to the /api URL.
Environments
You can target an environment with the following:
clea serve|build --target=<environment>
Environments mapping is made in the .clea-cli.json file:
environmentSource: "config/config.json",
environments: {
development: "config/config.dev.json",
production: "config/config.prod.json"
}