Search code examples
apachevisual-studio-coderefreshlocalauto

Visual studio code auto refresh browser with apache


Is there a way to set up (extension, etc...) Visual studio code to auto-refresh browser (Firefox Dev, Chrome Dev) as soon as the file I am working on is saved? (Like Live Server extension)

I am working with local installation of Apache (Yes, I am working on WordPress :)


Solution

  • Using this tutorial from youtube you will install the Live Server VSCode extension for use with html files. However, you will most likely (although you haven't mentioned) be using PHP or other languages because apache supports it. For this, use this tutorial from GitHub. It installs a browser extension (compatible with chrome/chromium-based/firefox browsers) that connects to a server instance and serves the reload function to that webserver. This does NOT install a web server (in this case it shouldn't matter). If you follow the tutorial, it should be really self-explanatory.