In a VS Code project I have HTML files which end in the (proprietary) extension .HML. How can Live Server in VS Code serve these files as HTML files?
I have seen starball's answer to "Why is VS Code Live Server opening...". It explains how some explicit files without .html extension can be served by Live Server, but I am after a solution which can serve all .hml files the same way as Live Server already saves all .html files.
Since mime type header is apparently the issue, I think you're out of luck unless you feel like forking the software or modifying your extension's installation. The Live Server extension uses the
sendnpm package to serve static files.senduses themimenpm package, which only mapshtml,htm, andshtmlto thetext/htmlmime type.I haven't tried this, but I think you could technically dig into your
~/.vscode/extensions/ritwickdey.liveserver-<version>//node_modules/mime/types.jsonand edit the file to add the extension you want, but you'd need to redo this every time the extension updates.Even then, it won't be exactly the same as how files with the
.htmlextension in their name are served, sincesendspecial-cases the filenameindex.html. Again, if you want a different behaviour, you'll need to fork or modify your installation.