4.7 KiB
Documentation below is for CLI version 6 and we no longer accept PRs to improve this. For version 7 see here.
ng serve
Overview
ng serve
builds the application and starts a web server.
ng serve [project]
Options
prod
--prod
Flag to set configuration to "prod".
configuration
--configuration
(alias: -c
)
Specify the configuration to use.
browser-target
--browser-target
Target to serve.
port
--port
Port to listen on.
host
--host
Host to listen on.
proxy-config
--proxy-config
Proxy configuration file.
ssl
--ssl
Serve using HTTPS.
ssl-key
--ssl-key
SSL key to use for serving HTTPS.
ssl-cert
--ssl-cert
SSL certificate to use for serving HTTPS.
open
--open
(alias: -o
)
Opens the url in default browser.
live-reload
--live-reload
Whether to reload the page on change, using live-reload.
public-host
--public-host
Specify the URL that the browser client will use.
serve-path
--serve-path
The pathname where the app will be served.
disable-host-check
--disable-host-check
Don't verify connected clients are part of allowed hosts.
hmr
--hmr
Enable hot module replacement.
watch
--watch
Rebuild on change.
hmr-warning
--hmr-warning
Show a warning when the --hmr option is enabled.
serve-path-default-warning
--serve-path-default-warning
Show a warning when deploy-url/base-href use unsupported serve path values.
optimization
--optimization
Enables optimization of the build output.
aot
--aot
Build using Ahead of Time compilation.
source-map
--source-map
Output sourcemaps.
eval-source-map
--eval-source-map
Output in-file eval sourcemaps.
vendor-source-map
--vendor-source-map
Resolve vendor packages sourcemaps.
vendor-chunk
--vendor-chunk
Use a separate bundle containing only vendor libraries.
common-chunk
--common-chunk
Use a separate bundle containing code used across multiple bundles.
base-href
--base-href
Base url for the application being built.
deploy-url
--deploy-url
URL where files will be deployed.
verbose
--verbose
Adds more details to output logging.
progress
--progress
Log progress to the console while building.