Search code examples
node.jsvisual-studiocompilationrecompile

Recompile on save isn't working


I started a Node.js project on Visual Studio 2017 Community on my PC at home, just to test a few things out and play around.

When I begin "debugging" (as in get Visual Studio to compile and launch the website), any changes I make and save to files are not reflected until I restart the entire debugging process. I've Node.js projects through Visual Studio on other computers, and they seemed to recompile the individual files as they were saved, reflecting any changes immediately. I can't seem to find anything online that would suggest a solution, I guess Visual Studio/node.js is a pretty rare combination.

My Visual Studio Community 2017 installation on Windows 10 is fairly slim. In terms of components:

  • Cloud, database, and server:
    • Connectivity and publishing tools
    • Web Deploy
  • Code tools: Developer Analytics tools
  • Debugging and testing: JavaScript diagnostics
  • Development activities:
    • JavaScript and TypeScript language support
    • Node.js support
  • SDKs, libraries, and frameworks: TypeScript 2.5 SDK

Would anyone how I can make Visual Studio recompile each file on save while debugging? It's definitely possible, I'm probably just missing something!


Solution

  • I've since figured that this is not native functionality for VisualStudio to recompile each time an application-dependent file is changed. There are, however, packages available that can allow Node to do this, such as Nodemon.