/Angular 7

ng serve

Builds and serves your app, rebuilding on file changes.

ng serve <project> [options]

ng s <project> [options]


Argument Description

The name of the project to build. Can be an app or a library.


Option Description

Build using Ahead of Time compilation.


Base url for the application being built.


Target to serve.


(experimental) Output file path for Build Event Protocol events


Use a separate bundle containing code used across multiple bundles.


A named build target, as specified in the "configurations" section of angular.json. Each named target is accompanied by a configuration of option defaults for that target.

Aliases: -c


URL where files will be deployed.


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

Default: false



Output in-file eval sourcemaps.

--help= true|false|json|JSON

Shows a help message for this command in the console.

Default: false


Enable hot module replacement.

Default: false


Show a warning when the --hmr option is enabled.

Default: true


Host to listen on.

Default: localhost


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

Default: true


Opens the url in default browser.

Default: false

Aliases: -o


Enables optimization of the build output.


Enable and define the file watching poll time period in milliseconds.


Port to listen on.

Default: 4200


When true, sets the build configuration to the production target. All builds make use of bundling and limited tree-shaking. A production build also runs limited dead code elimination.


Log progress to the console while building.


Proxy configuration file.


Specify the URL that the browser client will use.


The pathname where the app will be served.


Show a warning when deploy-url/base-href use unsupported serve path values.

Default: true


Output sourcemaps.

Default: true


Serve using HTTPS.

Default: false


SSL certificate to use for serving HTTPS.


SSL key to use for serving HTTPS.


Use a separate bundle containing only vendor libraries.



Resolve vendor packages sourcemaps.

Default: false


Adds more details to output logging.

Default: false


Rebuild on change.

Default: true

© 2010–2019 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.