Closed austinpickett closed 8 years ago
Thinking about this more in-depth, the issue is presented by the server trying to inject livereload.js on the body .. if there is no body, where is it to inject?
The only solution I could think of is checking for
I don't think not having a valid body is a use-case this library needs to be concerned with. The current injection matching rules are:
rules: [{
match: /<\/body>/,
fn: prepend
}, {
match: /<\/html>/,
fn: prepend
}, {
match: /<\!DOCTYPE.+>/,
fn: append
}]
So really you just need a DOCTYPE
tag to be present at the bare minimum.
I'm not sure if this is how the plugin is supposed to work or not, but without any HTML elements in the document the browser does not reload that page..
Example (index.html):
test
no live reloadExample (index.html w/ HTML)
Livereload works