Web Dev Solutions

Catalin Mititiuc

From 16fc0bf7938071b400364d705f9ac859068be5f3 Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Wed, 12 Jun 2024 10:50:06 -0700 Subject: WIP: modify dev server to use as test server, also --- src/index.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/index.js b/src/index.js index b562651..ee9cea9 100644 --- a/src/index.js +++ b/src/index.js @@ -7,6 +7,12 @@ import { scenarios } from './modules/scenarios.js'; globalThis.svgns = 'http://www.w3.org/2000/svg'; +if (window.IS_DEV) { + const source = new EventSource('/esbuild'); + source.addEventListener('change', () => location.reload()); + // source.addEventListener('message', (e) => console.log(e)); +} + const mapPlaceholder = document.querySelector('.map-placeholder'), distanceOutput = document.getElementById('status'), proneToggle = document.getElementById('toggle-prone-counter'), -- cgit v1.2.3