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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user