Skip to content

docs: Update application environment story. #10490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions docs/documentation/stories/application-environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Configuring available environments

`.angular-cli.json` contains an **environments** section. By default, this looks like:
`angular.json` contains an **environments** section for each application. By default, this looks like:

``` json
"environments": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I need to go through this doc myself, a lot changed here.

Expand Down Expand Up @@ -105,18 +105,22 @@ export class AppComponent {

## Environment-specific builds

Running:
Running builds for specific environements:

```
ng build
```

Will use the defaults found in `environment.ts`

Running:
- Inside `angular.json` create a configuration for the environment (i.e. staging)

```json
...{
"configurations": {
"staging": {
"fileReplacements": [{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.staging.ts",
}],
}
}
```
ng build --env=staging
2. Build your application by specifying the new configuration.
```bash
ng build --configuration staging
```

Will use the values from `environment.staging.ts`