tapio / live-server

A simple development http server with live reload capability.
http://tapiov.net/live-server/
4.41k stars 484 forks source link

live reloading doesn't work without certain tags #335

Open towc opened 4 years ago

towc commented 4 years ago
Before submitting an issue, please, see https://github.com/tapio/live-server#troubleshooting

Issue description

I was trying to use live-server on a barebones html file for quick prototyping, and didn't use any of the doctype/html/head/body boilerplate elements, as html5 automatically inserts them in the DOM if not present. After I added a <head>, live-reloading was working fine. I couldn't find this documented anywhere, and I only got it thanks to https://github.com/tapio/live-server/issues/242#issuecomment-375932248

I don't think this should be documented, but rather if it doesn't find a tag, it should just put the script at the top of the file, if the extension is html

Software details

andria-dev commented 4 years ago

I'm taking a shot at making a pull request that should solve this issue. Currently, there's a pull request out there, #289, but it seems like it injects the <script> tag inside the last tag available instead of prepending or appending it to the document.

andria-dev commented 4 years ago

Actually, looks like this project hasn't been updated in over a year. I'd consider this project dead now.

voltuer commented 4 years ago

Same here, any fixes?

towc commented 4 years ago

@sebolio add a <head></head> at the top