ng serve

Builds and serves your app, rebuilding on file changes.

ng serve <project> [options]
      ng serve <project> [options]
ng s <project> [options]
      ng s <project> [options]



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



Build using Ahead of Time compilation.

默认值: false


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.

默认值: false


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.

别名: -c


URL where files will be deployed.


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

默认值: false


Output in-file eval sourcemaps.

默认值: false


Shows a help message for this command in the console.

默认值: false


Enable hot module replacement.

默认值: false


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

默认值: true


Host to listen on.

默认值: localhost


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

默认值: true


Opens the url in default browser.

默认值: false

别名: -o


Enables optimization of the build output.

默认值: false


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


Port to listen on.

默认值: 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.

默认值: false


Log progress to the console while building.

默认值: false


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.

默认值: true


Output sourcemaps.

默认值: true


Serve using HTTPS.

默认值: false


SSL certificate to use for serving HTTPS.


SSL key to use for serving HTTPS.


Use a separate bundle containing only vendor libraries.

默认值: false


Resolve vendor packages sourcemaps.

默认值: false


Adds more details to output logging.

默认值: false


Rebuild on change.

默认值: true