Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop Visual Studio Code from endlessly recompiling

I'm working on an Angular 4 project in Visual Studio Code. Is there any way to stop it from endlessly recompiling? 'Ng serve' is the command I use. Ideally, what I would like Visual Studio Code to do is to rebuild automatically when I make changes, but not to get into a cycle of constant rebuilding and rebuilding without end, even when no changes are made. In those circumstances all I can do is CTRL-C to end the loop, and enter 'Ng serve' again. Does anyone know how to do that?

like image 412
Pismotality Avatar asked Feb 04 '18 05:02

Pismotality


People also ask

How do you stop infinite code in VS code?

You can stop any running command by pressing Ctrl + C on your keyboard.

How do I stop visual codes from running?

VS Code maintains a debug session while the program is running, and pressing the Stop button terminates the program.

How do I turn off auto compile in Visual Studio Code?

Just change it to "files. autoSave": "off", (which is the default). So your compilation should now only be triggered when you save..

How do you stop Angular application in Visual Studio Code?

Once you launch Angular application, the terminal still shows the previous command and it will not let you execute any other CLI command. To stop your angular application use the following command. This command will ask you to Terminate batch job(Y/N)?. Type Y and press Enter key.


1 Answers

Setting the watch option false will stop automatic rebuilds:

   ng serve --watch=false

The full list of ng serve options are here, or use --help after the command.

like image 152
JayChase Avatar answered Sep 20 '22 03:09

JayChase