Fix livereload for @import case

Fixes #6106
This commit is contained in:
Bjørn Erik Pedersen 2019-07-22 13:22:04 +02:00
parent 53da3881de
commit 2fc0abd22a
No known key found for this signature in database
GPG Key ID: 330E6E2BD4859D8F
2 changed files with 3 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -28,7 +28,7 @@ func New(port int) transform.Transformer {
b := ft.From().Bytes()
endBodyTag := "</body>"
match := []byte(endBodyTag)
replaceTemplate := `<script data-no-instant>document.write('<script src="/livereload.js?port=%d&mindelay=10"></' + 'script>')</script>%s`
replaceTemplate := `<script data-no-instant>document.write('<script src="/livereload.js?port=%d&mindelay=10&v=2"></' + 'script>')</script>%s`
replace := []byte(fmt.Sprintf(replaceTemplate, port, endBodyTag))
newcontent := bytes.Replace(b, match, replace, 1)