Closed RblSb closed 2 years ago
If you think that this is too fat, i will move this to personal plugin, i guess. On client side it looks like this:
#if kha_live_reload function openWebSocket():Void { var host = Browser.location.hostname; if (host == "") host = "localhost"; final port = "" + (Std.parseInt(Browser.location.port) + 1); final colonPort = port.length > 0 ? ':$port' : port; final path = Browser.location.pathname; final ws = new WebSocket('ws://$host$colonPort$path'); ws.onmessage = () -> Browser.location.reload(); } openWebSocket(); #end
Looks nicely simple. The removal of types/chokidar was just a mistake I assume, right?
Nope, that types/chokidar is not needed since chokidar 3 (ts types are out of box)
types/chokidar
Ah, all right, thanks.
If you think that this is too fat, i will move this to personal plugin, i guess. On client side it looks like this: