Angular
Installation
npm i -g @angular/cli
Usage
ng <command> [option]
ng new <project-name> [option]
ng add <dependency-name> [option]
ng generate <sub-command> [option]
ng serve [option]
ng build [option]
# Use with npm scripts
npm start
npm run build
// package.json e.g.:
{
"scripts": [
"start": "ng serve --port <port-number> --open --c development",
"build": "ng build --c production"
]
}
Commands (angular.io):
n
,new <project-name> [option]
, options:--defaults
(skips input prompts)--force
(overrides if needed)--minimal
(no testing frameworks)--routing
--strict
--style <css|scss|sass|less>
add <dependency-name>
g
,generate <sub-command>
, sub-commands:class
component
config
directive
enum
interface
module
s
,serve
, options:--browser-target
-c
,--configuration <production|development>
--hmr
(hot module replacement,false
by default)--host
-o
,--open
(false
by default)--port
(4200
by default)
b
,build
, options:-c
,--configuration <production|development>
--optimizations <scripts|styles|fonts> [sub-options]
, sub-options:styles
sub-options:minify
inlineCritical
fonts
sub-option:inline
--watch
config <config-file>
More at: