This is useful when you don't want the server to rebuild in the middle of something. A good example is when running e2e tests. Especially on larger suites, one would prefer to continue working while the build is tested without compromising tests. This will break tests on #4744. They should be adjusted to add the `--watch` flag since they depend on the live reload behaviour during `ng e2e`.
1.8 KiB
ng serve
Overview
ng serve
builds the application and starts a web server
Options
--watch
(-w
) rebuild when files change
--port
(-p
) port to serve the application on
--host
(-H
) host where to listen
--proxy-config
(-pc
) proxy configuration file
--live-reload
(-lr
) flag to turn off live reloading
--live-reload-host
(-lrh
) specify the host for live reloading
--live-reload-base-url
(-lrbu
) specify the base URL for live reloading
--live-reload-port
(-lrp
) port for live reloading
--live-reload-live-css
flag to live reload CSS
--ssl
flag to turn on SSL
--ssl-key
path to the SSL key
--ssl-cert
path to the SSL cert
--open
(-o
) opens the app in the default browser
--hmr
use hot module reload
--target
(-t
) define the build target
--environment
(-e
) defines the build environment
--prod
flag to set build target and environment to production
--dev
flag to set build target and environment to development
--output-path
(-po
) path where output will be placed
--aot
flag whether to build using Ahead of Time compilation
--sourcemap
(-sm
) output sourcemaps
--vendor-chunk
(-vb
) use a separate bundle containing only vendor libraries
--base-href
(-bh
) base url for the application being built
--deploy-url
(-d
) url where files will be deployed
--verbose
(-v
) adds more details to output logging
--progress
(-pr
) log progress to the console while building
--extract-css
(-ec
) extract css from global styles onto css files instead of js ones
--output-hashing
define the output filename cache-busting hashing mode
--poll
enable and define the file watching poll time period (milliseconds)