Skip to main content
Module

x/vno/core/utils/livereload.ts>liveReloadScript

a build tool for compiling and bundling Vue single-file components
Latest
variable liveReloadScript
import { liveReloadScript } from "https://deno.land/x/vno@1.5.1/core/utils/livereload.ts";

type

` // ===========================\n // LIVE RELOADING\n // Create WebSocket connection. const socket = new WebSocket("ws://localhost:8080"); const reloadWindow = () => { window.location.reload(); }; // Connection opened socket.addEventListener("open", function (event) { socket.send("[LiveReload client connected]"); }); // Listen for messages socket.addEventListener("message", function (event) { socket.send("[LiveReload reloading...]"); if (event.data === 'reload window') { reloadWindow(); } }); // ===========================\n `