HMR
Add environment for HMR
export const environment = {
production: false,
hmr: true
};export const environment = {
production: true,
hmr: false
};export const environment = {
production: false,
hmr: false
}; "build": {
"configurations": {
...
"hmr": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.hmr.ts"
}
]
}
}
},
...
"serve": {
"configurations": {
...
"hmr": {
"hmr": true,
"browserTarget": "<project-name>:build:hmr"
}
}
}Add dependency and configure app
(OPTIONAL) Update src/app/app.module.ts to manage the state in HMR lifecycle:
Starting the development environment with HMR enabled

HMR lifecycle
HMR Options
HMR Utils
Last updated

