diff --git a/adev/src/content/reference/configs/workspace-config.md b/adev/src/content/reference/configs/workspace-config.md index 1dd1eb0fa90..4160d33a4bb 100644 --- a/adev/src/content/reference/configs/workspace-config.md +++ b/adev/src/content/reference/configs/workspace-config.md @@ -12,7 +12,7 @@ You can also override defaults set at the project level using the command line. The following properties, at the top-level of the file, configure the workspace. | Properties | Details | -|:--- |:--- | +| :--------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `version` | The configuration-file version. | | `newProjectRoot` | Path where new projects are created through tools like `ng generate application` or `ng generate library`. Path can be absolute or relative to the workspace directory. Defaults to `projects` | | `cli` | A set of options that customize the [Angular CLI](tools/cli). See [Angular CLI configuration options](#angular-cli-configuration-options) below. | @@ -24,9 +24,11 @@ The initial application that you create with `ng new app-name` is listed under " When you create a library project with `ng generate library`, the library project is also added to the `projects` section. HELPFUL: The `projects` section of the configuration file does not correspond exactly to the workspace file structure. + -* The initial application created by `ng new` is at the top level of the workspace file structure. -* Other applications and libraries are under the `projects` directory by default. + +- The initial application created by `ng new` is at the top level of the workspace file structure. +- Other applications and libraries are under the `projects` directory by default. For more information, see [Workspace and project file structure](reference/configs/file-structure). @@ -34,26 +36,26 @@ For more information, see [Workspace and project file structure](reference/confi The following properties are a set of options that customize the Angular CLI. -| Property | Details | Value type | Default value | -|:--- |:--- |:--- |:--- | -| `analytics` | Share anonymous usage data with the Angular Team. A boolean value indicates whether or not to share data, while a UUID string shares data using a pseudonymous identifier. | `boolean` \| `string` | `false` | -| `cache` | Control [persistent disk cache](cli/cache) used by [Angular CLI Builders](tools/cli/cli-builder). | [Cache options](#cache-options) | `{}` | -| `schematicCollections`| List schematics collections to use in `ng generate`. | `string[]` | `[]` | -| `packageManager` | The preferred package manager tool to use. | `npm` \| `cnpm` \| `pnpm` \| `yarn`\| `bun` | `npm` | -| `warnings` | Control Angular CLI specific console warnings. | [Warnings options](#warnings-options) | `{}` | +| Property | Details | Value type | Default value | +| :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------ | :------------ | +| `analytics` | Share anonymous usage data with the Angular Team. A boolean value indicates whether or not to share data, while a UUID string shares data using a pseudonymous identifier. | `boolean` \| `string` | `false` | +| `cache` | Control [persistent disk cache](cli/cache) used by [Angular CLI Builders](tools/cli/cli-builder). | [Cache options](#cache-options) | `{}` | +| `schematicCollections` | List schematics collections to use in `ng generate`. | `string[]` | `[]` | +| `packageManager` | The preferred package manager tool to use. | `npm` \| `cnpm` \| `pnpm` \| `yarn`\| `bun` | `npm` | +| `warnings` | Control Angular CLI specific console warnings. | [Warnings options](#warnings-options) | `{}` | ### Cache options -| Property | Details | Value type | Default value | -|:--- |:--- |:--- |:--- | -| `enabled` | Configure whether disk caching is enabled for builds. | `boolean` | `true` | -| `environment` | Configure in which environment disk cache is enabled.

* `ci` enables caching only in continuous integration (CI) environments.
* `local` enables caching only *outside* of CI environments.
* `all` enables caching everywhere. | `local` \| `ci` \| `all` | `local` | -| `path` | The directory used to stored cache results. | `string` | `.angular/cache` | +| Property | Details | Value type | Default value | +| :------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------- | :--------------- | +| `enabled` | Configure whether disk caching is enabled for builds. | `boolean` | `true` | +| `environment` | Configure in which environment disk cache is enabled.

_ `ci` enables caching only in continuous integration (CI) environments.
_ `local` enables caching only _outside_ of CI environments.
\* `all` enables caching everywhere. | `local` \| `ci` \| `all` | `local` | +| `path` | The directory used to stored cache results. | `string` | `.angular/cache` | ### Warnings options | Property | Details | Value type | Default value | -|:--- |:--- |:--- |:--- | +| :---------------- | :------------------------------------------------------------------------------ | :--------- | :------------ | | `versionMismatch` | Show a warning when the global Angular CLI version is newer than the local one. | `boolean` | `true` | ## Project configuration options @@ -61,7 +63,7 @@ The following properties are a set of options that customize the Angular CLI. The following top-level configuration properties are available for each project, under `projects['project-name']`. | Property | Details | Value type | Default value | -|:--- |:--- |:--- |:--- | +| :------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------- | :-------------- | | `root` | The root directory for this project's files, relative to the workspace directory. Empty for the initial application, which resides at the top level of the workspace. | `string` | None (required) | | `projectType` | One of "application" or "library" An application can run independently in a browser, while a library cannot. | `application` \| `library` | None (required) | | `sourceRoot` | The root directory for this project's source files. | `string` | `''` | @@ -84,15 +86,15 @@ You can update your workspace schema file to set a different default for a sub-c { - "projects": { - "my-app": { - "schematics": { - "@schematics/angular:component": { - "standalone": false - } - } - } - } +"projects": { +"my-app": { +"schematics": { +"@schematics/angular:component": { +"standalone": false +} +} +} +} } @@ -121,7 +123,7 @@ Each target also has an `options` section that configures default options for th See the example in [Build target](#build-target) below. | Property | Details | -|:--- |:--- | +| :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `build` | Configures defaults for options of the `ng build` command. See the [Build target](#build-target) section for more information. | | `serve` | Overrides build defaults and supplies extra serve defaults for the `ng serve` command. Besides the options available for the `ng build` command, it adds options related to serving the application. | | `e2e` | Overrides build defaults for building end-to-end testing applications using the `ng e2e` command. | @@ -135,29 +137,29 @@ HELPFUL: All options in the configuration file must use `camelCase`, rather than Each target under `architect` has the following properties: -| Property | Details | -|:--- |:--- | -| `builder` | The CLI builder used to create this target in the form of `:`. | -| `options` | Build target default options. | -| `configurations`| Alternative configurations for executing the target. Each configuration sets the default options for that intended environment, overriding the associated value under `options`. See [Alternate build configurations](#alternate-build-configurations) below. | +| Property | Details | +| :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `builder` | The CLI builder used to create this target in the form of `:`. | +| `options` | Build target default options. | +| `configurations` | Alternative configurations for executing the target. Each configuration sets the default options for that intended environment, overriding the associated value under `options`. See [Alternate build configurations](#alternate-build-configurations) below. | For example, to configure a build with optimizations disabled: { - "projects": { - "my-app": { - "architect": { - "build": { - "builder": "@angular-devkit/build-angular:application", - "options": { - "optimization": false - } - } - } - } - } +"projects": { +"my-app": { +"architect": { +"build": { +"builder": "@angular-devkit/build-angular:application", +"options": { +"optimization": false +} +} +} +} +} } @@ -167,10 +169,10 @@ For example, to configure a build with optimizations disabled: Angular CLI comes with two build configurations: `production` and `development`. By default, the `ng build` command uses the `production` configuration, which applies several build optimizations, including: -* Bundling files -* Minimizing excess whitespace -* Removing comments and dead code -* Minifying code to use short, mangled names +- Bundling files +- Minimizing excess whitespace +- Removing comments and dead code +- Minifying code to use short, mangled names You can define and name extra alternate configurations (such as `staging`, for instance) appropriate to your development process. You can select an alternate configuration by passing its name to the `--configuration` command line flag. @@ -180,23 +182,23 @@ For example, to configure a build where optimization is enabled only for product { - "projects": { - "my-app": { - "architect": { - "build": { - "builder": "@angular-devkit/build-angular:application", - "options": { - "optimization": false - }, - "configurations": { - "production": { - "optimization": true - } - } - } - } - } - } +"projects": { +"my-app": { +"architect": { +"build": { +"builder": "@angular-devkit/build-angular:application", +"options": { +"optimization": false +}, +"configurations": { +"production": { +"optimization": true +} +} +} +} +} +} } @@ -209,18 +211,26 @@ In this example, if both `staging` and `french` configurations set the output pa ### Extra build and test options -The configurable options for a default or targeted build generally correspond to the options available for the [`ng build`](cli/build), [`ng serve`](cli/serve), and [`ng test`](cli/test) commands. +The configurable options for a default or targeted build generally correspond to the options available for the [`ng build`](cli/build), and [`ng test`](cli/test) commands. For details of those options and their possible values, see the [Angular CLI Reference](cli). | Options properties | Details | -|:--- |:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `assets` | An object containing paths to static assets to serve with the application. The default paths point to the project's `public` directory. See more in the [Assets configuration](#assets-configuration) section. | +| :------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `assets` | An object containing paths to static assets to serve with the application. The default paths point to the project's `public` directory. See more in the [Assets configuration](#assets-configuration) section. | | `styles` | An array of CSS files to add to the global context of the project. Angular CLI supports CSS imports and all major CSS preprocessors. See more in the [Styles and scripts configuration](#styles-and-scripts-configuration) section. | | `stylePreprocessorOptions` | An object containing option-value pairs to pass to style preprocessors. See more in the [Styles and scripts configuration](#styles-and-scripts-configuration) section. | | `scripts` | An object containing JavaScript files to add to the application. The scripts are loaded exactly as if you had added them in a `