5 lines
23 KiB
JSON
Raw Permalink Normal View History

{
"id": "cli/build",
"title": "ng build",
"contents": "\n<article>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular-cli/edit/master/packages/angular/cli/commands/build.json?message=docs(...)%3A%20describe%20your%20change...\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular-cli/tree/v12.0.0-next.7/packages/angular/cli/commands/build.json\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n \n\n\n<div class=\"breadcrumb\">\n <script type=\"application/ld+json\">\n {\n \"@context\": \"http://schema.org\",\n \"@type\": \"BreadcrumbList\",\n \"itemListElement\": [\n { \"@type\": \"ListItem\", \"position\": 1, \"item\": { \"@id\": \"https://angular.io/cli\", \"name\": \"CLI\" } },\n { \"@type\": \"ListItem\", \"position\": 2, \"item\": { \"@id\": \"https://angular.io/cli/build\", \"name\": \"build\" } }\n ]\n }\n </script>\n <a href=\"cli\">CLI</a>\n</div>\n\n \n<header class=\"cli-header\">\n <h1 id=\"ng-build\">ng build<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"cli/build#ng-build\"><i class=\"material-icons\">link</i></a></h1>\n</header>\n\n\n <aio-toc class=\"embedded\"></aio-toc>\n\n <div class=\"cli-body\">\n \n <p>Compiles an Angular app into an output directory named dist/ at the given output path. Must be executed from within a workspace directory.</p>\n\n \n<code-example hidecopy=\"true\" class=\"no-box api-heading no-auto-link\">ng <span class=\"cli-name\">build</span> &#x3C;<var>project</var>> [<var>options</var>]</code-example>\n\n<code-example hidecopy=\"true\" class=\"no-box api-heading no-auto-link\">ng <span class=\"cli-name\">b</span> &#x3C;<var>project</var>> [<var>options</var>]</code-example>\n\n\n\n \n <h2 class=\"no-anchor\" id=\"mode_edit---code----------description\">\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular-cli/edit/master/packages/angular/cli/commands/build-long.md?message=docs%3A%20describe%20your%20change...\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular-cli/tree/v12.0.0-next.7/packages/angular/cli/commands/build-long.md\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n Description\n </h2>\n <p>The command can be used to build a project of type \"application\" or \"library\".\nWhen used to build a library, a different builder is invoked, and only the <code>ts-config</code>, <code>configuration</code>, and <code>watch</code> options are applied.\nAll other options apply only to building applications.</p>\n<p>The application builder uses the <a href=\"https://webpack.js.org/\">webpack</a> build tool, with default configuration options specified in the workspace configuration file (<code>angular.json</code>) or with a named alternative configuration.\nA \"development\" configuration is created by default when you use the CLI to create the project, and you can use that configuration by specifying the <code>--configuration development</code>.</p>\n<p>The configuration options generally correspond to the command options.\nYou can override individual configuration defaults by specifying the corresponding options on the command line.\nThe command can accept option names given in either dash-case or camelCase.\nNote that in the configuration file, you must specify names in camelCase.</p>\n<p>Some additional options can only be set through the configuration file,\neither by direct editing or with the <code>ng config</code> command.\nThese include <code>assets</code>, <code>styles</code>, and <code>scripts</code> objects that provide runtime-global resources to include in the project.\nResources in CSS, such as images and fonts
}