Skip to content

Commit

Permalink
docs(docs): documented environment support
Browse files Browse the repository at this point in the history
ISSUES CLOSED: #50
  • Loading branch information
Mallikki committed Jun 14, 2018
1 parent 96811ab commit 185fe24
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions docs/ENVIRONMENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,62 @@ export const environment: Environment = {
...
```

This file will then be replaced by the file needed for the environment in `angular.json` config file:

```
...
"configurations": {
"hmr": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.hmr.ts"
}
]
},
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
},
"e2e.prod": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.e2e.prod.ts"
}
]
...
```

## How to add a new environment?

You can add as many environments as you want, as long as you define their options and file replacement in `angular.json`:
and you add the actual needed file in `src/environments`:

If you do add an environment, don't forget to adapt as well the `src/environments/model.ts` file and to add your own env.

## How to find out which environment is your application is currently using?

All you have to do is to import in your app.module.ts file the environment.ts constant
Expand Down

0 comments on commit 185fe24

Please sign in to comment.