ng serve
Builds and serves your app, rebuilding on file changes.
ng serve <project> [options]
ng s <project> [options]
参数
参数 | 说明 |
---|---|
<project> | The name of the project to build. Can be an app or a library. |
选项
选项 | 说明 |
---|---|
--aot=true|false | Build using Ahead of Time compilation. 默认值: |
--baseHref=baseHref | Base url for the application being built. |
--browserTarget=browserTarget | Target to serve. |
--buildEventLog=buildEventLog | (experimental) Output file path for Build Event Protocol events |
--commonChunk=true|false | Use a separate bundle containing code used across multiple bundles. 默认值: |
--configuration=configuration | 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 |
--deployUrl=deployUrl | URL where files will be deployed. |
--disableHostCheck=true|false | Don't verify connected clients are part of allowed hosts. 默认值: |
--evalSourceMap=true|false | Output in-file eval sourcemaps. 默认值: |
--help= | Shows a help message for this command in the console. 默认值: |
--hmr=true|false | Enable hot module replacement. 默认值: |
--hmrWarning=true|false | Show a warning when the --hmr option is enabled. 默认值: |
--host=host | Host to listen on. 默认值: |
--liveReload=true|false | Whether to reload the page on change, using live-reload. 默认值: |
--open=true|false | Opens the url in default browser. 默认值: 别名: -o |
--optimization=true|false | Enables optimization of the build output. 默认值: |
--poll | Enable and define the file watching poll time period in milliseconds. |
--port | Port to listen on. 默认值: |
--prod=true|false | 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. 默认值: |
--progress=true|false | Log progress to the console while building. 默认值: |
--proxyConfig=proxyConfig | Proxy configuration file. |
--publicHost=publicHost | Specify the URL that the browser client will use. |
--servePath=servePath | The pathname where the app will be served. |
--servePathDefaultWarning=true|false | Show a warning when deploy-url/base-href use unsupported serve path values. 默认值: |
--sourceMap=true|false | Output sourcemaps. 默认值: |
--ssl=true|false | Serve using HTTPS. 默认值: |
--sslCert=sslCert | SSL certificate to use for serving HTTPS. |
--sslKey=sslKey | SSL key to use for serving HTTPS. |
--vendorChunk=true|false | Use a separate bundle containing only vendor libraries. 默认值: |
--vendorSourceMap=true|false | Resolve vendor packages sourcemaps. 默认值: |
--verbose=true|false | Adds more details to output logging. 默认值: |
--watch=true|false | Rebuild on change. 默认值: |