I am developing an Angular application using IntelliJ IDEA. I run ng server in the terminal window. angular cli automatically recompile whenever I change any code, and causes the browser constantly reloading. I would like angular cli to recompile only when I click "build project" icon or press Ctrl+S. I have spent hours looking at both IntelliJ and angular cli, but could not find anything on how to make it happen. Please help if you know how
Finally find the settings in IntelliJ.
Go to [Settings ->Appearance & Behavior ->System Settings] and uncheck the following options:
Live Reload on saving is Angular CLI feature that can be disabled by passing --no-live-reload
to ng serve
. But it only rebuilds and reloads the page on explicit Save, not on each file change. To make it work on hitting Ctrl+S
only, you need to disable auto-saving in IDEA.
IDEA doesn't normally auto-save files on each key pressing. If it only happens while debugging your app, check if Live Edit (that is active during debug session) is enabled in Settings | Build, Execution, Deployment | Debugger | Live Edit - it auto-saves files to provide live reload.
Some other plugins can also be responsible for auto-saving - for example, third-party SonarLint and ESLint plugins are known for causing such issues, as they save files to run analysis on the changes, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With