Search code examples
htmlvisual-studio-codewindows-subsystem-for-linux

What is the best way to open html files from vscode when using WSL?


Specifically, I am using the open-in-browser extension, but when I go to open my html for a given project it fails to load in the browser. I have tried putting my repo in both a straight Linux directory as well as in a folder in c/mnt/Users... Is there a way around this?


Solution

  • After stumbling on the same issue I found a straightforward extension to solve the issue: https://marketplace.visualstudio.com/items?itemName=peakchen90.open-html-in-browser

    This extension does not serve the file from the filesystem, but rather serves it from a local webserver.

    I was rather looking for something that would convert the WSL filepath into the corresponding windows filepath, but this works just as well if not better, for webdev purposes.