Skip to content
Merged
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
20 changes: 10 additions & 10 deletions docs/documentation/stories/configure-hmr.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,29 @@ export const environment = {
```


Update `.angular-cli.json` by adding the new environment the existing environments object:
Update `angular.json` to include an hmr environment as explained [here](./application-environments) and add a configuration within serve to enable hmr.

```json
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"hmr": "environments/environment.hmr.ts",
"prod": "environments/environment.prod.ts"
},
"serve": {
"configuration": {
...
"hmr": true
}
}
```

Run `ng serve` with the flag `--hmr -e=hmr` to enable hmr and select the new environment:
Run `ng serve` with the flag `--configuration hmr` to enable hmr and select the new environment:

```bash
ng serve --hmr -e=hmr
ng serve --configuration hmr
```

Create a shortcut for this by updating `package.json` and adding an entry to the script object:

```json
"scripts": {
...
"hmr": "ng serve --hmr -e=hmr"
"hmr": "ng serve --configuration hmr"
}
```

Expand Down