Add dev server with livereload

npm run dev starts a dev server on port 8080 serving the test
page and ribbit dist files. Watches src/ and test/integration/
for changes, rebuilds automatically, and notifies connected
browsers to reload via EventSource on port 8081.

The test page includes a livereload script that auto-reloads
when the dev server signals a rebuild.
This commit is contained in:
gsb
2026-04-30 22:47:26 +00:00
parent 24560a4d21
commit bfc20f56bf
3 changed files with 112 additions and 0 deletions
+5
View File
@@ -42,5 +42,10 @@
editor.run();
window.__ribbitEditor = editor;
</script>
<script>
// Livereload — connects to dev server's EventSource endpoint.
// Silently fails if the dev server isn't running.
try { new EventSource('http://localhost:8081').onmessage = () => location.reload(); } catch(e) {}
</script>
</body>
</html>