Skip to content

Commit dea158c

Browse files
committedNov 25, 2024··
commands: Fix flaw in the livereload logic
I guess most commonly an issue with TailwindCSS editing in templates: * Build changes both CSS and index.html => reload OK. * Build changes both CSS and index.html and some other files => only CSS reloaded. The above would fix itself with one more edit, but that's annoying.
1 parent 467444e commit dea158c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎commands/hugobuilder.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ func (c *hugoBuilder) handleEvents(watcher *watcher.Batcher,
966966
pathToRefresh := h.PathSpec.RelURL(paths.ToSlashTrimLeading(otherChanges[0]), false)
967967
lrl.Logf("refreshing %q", pathToRefresh)
968968
livereload.RefreshPath(pathToRefresh)
969-
} else if len(cssChanges) == 0 {
969+
} else if len(cssChanges) == 0 || len(otherChanges) > 1 {
970970
lrl.Logf("force refresh")
971971
livereload.ForceRefresh()
972972
}

0 commit comments

Comments
 (0)
Please sign in to comment.