On vscode any angular code changing triggers a page refresh which reset all states from my current route getting it so frustating to develop over. I’d like to change the app without reloading entire page like vite on react
Below is my angular json:
"architect": {
...
"build": {
...
"serve": {
"options": {
"liveReload": true
},
And package.json:
"scripts": {
"ng": "ng",
"start": "ng serve --live-reload",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
2
Answers
Hot module reload, HMR is a feature that partially landed in v19.
It includes
NG_HMR_TEMPLATES=1
In v19.1, that feature will be extended to include inline templates & won’t require the flag anymore.
There is no visibility on HMR for the component itself.
I always do
ng serve --live-reload false
. See if it works