2017-03-31 16:59:33 -07:00

5.2 KiB

ng serve

Overview

ng serve builds the application and starts a web server.

All the build Options are available in serve, below are the additional options.

Options

host

--host (aliases: -H) default value: localhost

Listens only on localhost by default.

hmr

--hmr default value: false

Enable hot module replacement.

live-reload

--live-reload (aliases: -lr) default value: true

Whether to reload the page on change, using live-reload.

live-reload-client

--live-reload-client

Specify the URL that the live reload browser client will use.

open

--open (aliases: -o) default value: false

Opens the url in default browser.

port

--port (aliases: -p) default value: 4200

Port to listen to for serving.

ssl

--ssl

Serve using HTTPS.

ssl-cert

--ssl-cert (aliases: -) default value:

SSL certificate to use for serving HTTPS.

ssl-key

--ssl-key

SSL key to use for serving HTTPS.

aot

--aot

Build using Ahead of Time compilation.

base-href

--base-href (aliases: -bh)

Base url for the application being built.

deploy-url

--deploy-url (aliases: -d)

URL where files will be deployed.

environment

--environment (aliases: -e)

Defines the build environment.

extract-css

--extract-css (aliases: -ec)

Extract css from global styles onto css files instead of js ones.

i18n-file

--i18n-file

Localization file to use for i18n.

i18n-format

--i18n-format

Format of the localization file specified with --i18n-file.

locale

--locale

Locale to use for i18n.

output-hashing

--output-hashing (aliases: -oh) default value:

Define the output filename cache-busting hashing mode. Possible values: none, all, media, bundles

output-path

--output-path (aliases: -op) default value:

Path where output will be placed.

poll

--poll

Enable and define the file watching poll time period (milliseconds) .

progress

--progress (aliases: -pr) default value: true

Log progress to the console while building.

sourcemap

--sourcemap (aliases: -sm, sourcemaps)

Output sourcemaps.

target

--target (aliases: -t, -dev, -prod) default value: development

Defines the build target.

vendor-chunk

--vendor-chunk (aliases: -vc) default value: true

Use a separate bundle containing only vendor libraries.

verbose

--verbose (aliases: -v) default value: false

Adds more details to output logging.

watch

--watch (aliases: -w)

Run build when files change.

Note

When running ng serve, the compiled output is served from memory, not from disk. This means that the application being served is not located on disk in the dist folder.