Skip to content

Latest commit

 

History

History
316 lines (281 loc) · 6.38 KB

serve.md

File metadata and controls

316 lines (281 loc) · 6.38 KB

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.

public-host

--public-host (aliases: --live-reload-client)

Specify the URL that the browser client will use.

disable-host-check

--disable-host-check default value: false

Don't verify connected clients are part of allowed hosts.

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. --port 0 will get a free port

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.

missing-translation

--missing-translation

How to handle missing translations for i18n.

Values: error, warning, ignore

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 inside TTY, false otherwise

Log progress to the console while building.

proxy-config

--proxy-config (aliases: -pc)

Use a proxy configuration file to send some requests to a backend server rather than the webpack dev server.

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.

common-chunk

--common-chunk (aliases: -cc) default value: true

Use a separate bundle containing code used across multiple bundles.

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.