5 lines
34 KiB
JSON
5 lines
34 KiB
JSON
|
{
|
||
|
"id": "guide/workspace-config",
|
||
|
"title": "Angular workspace configuration",
|
||
|
"contents": "\n\n\n<div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/aio/content/guide/workspace-config.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</div>\n\n\n<div class=\"content\">\n <h1 id=\"angular-workspace-configuration\">Angular workspace configuration<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"guide/workspace-config#angular-workspace-configuration\"><i class=\"material-icons\">link</i></a></h1>\n<p>A file named <code>angular.json</code> at the root level of an Angular <a href=\"guide/glossary#workspace\">workspace</a> provides workspace-wide and project-specific configuration defaults for build and development tools provided by the Angular CLI.\nPath values given in the configuration are relative to the root workspace folder.</p>\n<h2 id=\"overall-json-structure\">Overall JSON structure<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"guide/workspace-config#overall-json-structure\"><i class=\"material-icons\">link</i></a></h2>\n<p>At the top level of <code>angular.json</code>, a few properties configure the workspace, and a <code>projects</code> section contains the remaining per-project configuration options. CLI defaults set at the workspace level can be overridden by defaults set at the project level, and defaults set at the project level can be overridden on the command line.</p>\n<p>The following properties, at the top level of the file, configure the workspace.</p>\n<ul>\n<li><code>version</code>: The configuration-file version.</li>\n<li><code>newProjectRoot</code>: Path where new projects are created. Absolute or relative to the workspace folder.</li>\n<li><code>defaultProject</code>: Default project name to use in commands, where not provided as an argument. When you use <code>ng new</code> to create a new app in a new workspace, that app is the default project for the workspace until you change it here.</li>\n<li><code>schematics</code> : A set of <a href=\"guide/glossary#schematic\">schematics</a> that customize the <code>ng generate</code> sub-command option defaults for this workspace. See <a href=\"guide/workspace-config#schematics\">Generation schematics</a> below.</li>\n<li><code>projects</code> : Contains a subsection for each project (library or application) in the workspace, with the per-project configuration options.</li>\n</ul>\n<p>The initial app that you create with <code>ng new app_name</code> is listed under \"projects\":</p>\n<code-example language=\"json\">\n\n\"projects\": {\n \"app_name\": {\n ...\n }\n ...\n}\n\n</code-example>\n<p>When you create a library project with <code>ng generate library</code>, the library project is also added to the <code>projects</code> section.</p>\n<div class=\"alert is-helpful\">\n<p> Note that the <code>projects</code> section of the configuration file does not correspond exactly to the workspace file structure.</p>\n<ul>\n<li>\n<p>The initial app created by <code>ng new</code> is at the top level of the workspace file structure.</p>\n</li>\n<li>\n<p>Additional applications and libraries go into a <code>projects</code> folder in the workspace.</p>\n<p>For more information, see <a href=\"guide/file-structure\">Workspace and project file structure</a>.</p>\n</li>\n</ul>\n</div>\n<h2 id=\"strict-mode\">Strict mode<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"guide/workspace-config#strict-mode\"><i class=\"material-icons\">link</i></a></h2>\n<p>When you create new workspaces and projects, you have the option to use Angular's strict mode, which can help you write better, more maintainable code.\nFor more information, see <a href=\"/guide/strict-mode\">Strict mode</a>.</p>\n<h2 id=\"project-configuration-options\">Project configuration options<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"guide/workspace-config#project-con
|
||
|
}
|