5 lines
23 KiB
JSON
5 lines
23 KiB
JSON
|
{
|
||
|
"id": "guide/file-structure",
|
||
|
"title": "Workspace and project file structure",
|
||
|
"contents": "\n\n\n<div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/aio/content/guide/file-structure.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=\"workspace-and-project-file-structure\">Workspace and project file structure<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"guide/file-structure#workspace-and-project-file-structure\"><i class=\"material-icons\">link</i></a></h1>\n<p>You develop applications in the context of an Angular <a href=\"guide/glossary#workspace\">workspace</a>. A workspace contains the files for one or more <a href=\"guide/glossary#project\">projects</a>. A project is the set of files that comprise a standalone application or a shareable library.</p>\n<p>The Angular CLI <code>ng new</code> command creates a workspace.</p>\n<code-example language=\"bash\">\nng new <my-project>\n</code-example>\n<p>When you run this command, the CLI installs the necessary Angular npm packages and other dependencies in a new workspace, with a root-level application named <em>my-project</em>.\nThe workspace root folder contains various support and configuration files, and a README file with generated descriptive text that you can customize.</p>\n<p>By default, <code>ng new</code> creates an initial skeleton application at the root level of the workspace, along with its end-to-end tests.\nThe skeleton is for a simple Welcome application that is ready to run and easy to modify.\nThe root-level application has the same name as the workspace, and the source files reside in the <code>src/</code> subfolder of the workspace.</p>\n<p>This default behavior is suitable for a typical \"multi-repo\" development style where each application resides in its own workspace.\nBeginners and intermediate users are encouraged to use <code>ng new</code> to create a separate workspace for each application.</p>\n<p>Angular also supports workspaces with <a href=\"guide/file-structure#multiple-projects\">multiple projects</a>.\nThis type of development environment is suitable for advanced users who are developing <a href=\"guide/glossary#library\">shareable libraries</a>,\nand for enterprises that use a \"monorepo\" development style, with a single repository and global configuration for all Angular projects.</p>\n<p>To set up a monorepo workspace, you should skip the creating the root application.\nSee <a href=\"guide/file-structure#multiple-projects\">Setting up for a multi-project workspace</a> below.</p>\n<h2 id=\"workspace-configuration-files\">Workspace configuration files<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"guide/file-structure#workspace-configuration-files\"><i class=\"material-icons\">link</i></a></h2>\n<p>All projects within a workspace share a <a href=\"guide/workspace-config\">CLI configuration context</a>.\nThe top level of the workspace contains workspace-wide configuration files, configuration files for the root-level application, and subfolders for the root-level application source and test files.</p>\n<table>\n<thead>\n<tr>\n<th align=\"left\">WORKSPACE CONFIG FILES</th>\n<th align=\"left\">PURPOSE</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"left\"><code>.editorconfig</code></td>\n<td align=\"left\">Configuration for code editors. See <a href=\"https://editorconfig.org/\">EditorConfig</a>.</td>\n</tr>\n<tr>\n<td align=\"left\"><code>.gitignore</code></td>\n<td align=\"left\">Specifies intentionally untracked files that <a href=\"https://git-scm.com/\">Git</a> should ignore.</td>\n</tr>\n<tr>\n<td align=\"left\"><code>README.md</code></td>\n<td align=\"left\">Introductory documentation for the root app.</td>\n</tr>\n<tr>\n<td align=\"left\"><code>angular.json</code></td>\n<td align=\"left\">CLI configuration defaults for all projects in the workspace, including configuration options for build, serve, and test tool
|
||
|
}
|