VS Code compiling on opening a new file

Viewed 536

Since last week or so, when I am on ng serve, VS Code compile the app again when I open existing files in the project.

In theory, the compile should just happen when I save a file and not by opening a file.

Other developers in the team aren't facing the same issue, I have tried to disable all extension we have with the exception of Nx Console and Material Icon Theme. Even so, the behavior persists, which indicates that is not an extension issue.

Do anyone knows what is triggering the compile of app, or maybe some way to identify why it's being triggered?

The answer I'm looking for is how to stop that behavior, I want the compile process to be triggered only when I save changes to a file, and not everytime I open an existing one.

2 Answers

For anyone with the above issue, to the moment of this, I have neither a solution nor the root cause.

But I did found a way to bypass the problem using ng serve --poll 5000. Found that on https://angular.io/cli/serve

From what I found over the interwebs, it basically shifts who is responsible for detecting file changes. The 5000 is just the amount of seconds before triggering the rebuild. I have been using a couple of months now (maybe more) and did not notice any serious tradeoffs so far.

maybe you should disable/off autosave onWindowChange that make your project compiling when you open the others files... manage -> setting : files autosave

Related