2021-03-09 01:13:42 +01:00
|
|
|
import App from './App.svelte';
|
|
|
|
|
|
|
|
const app = new App({
|
|
|
|
target: document.body
|
|
|
|
});
|
|
|
|
|
2021-03-13 01:31:32 +01:00
|
|
|
//@ts-ignore
|
|
|
|
if (IS_DEV) {
|
|
|
|
let ws, int;
|
|
|
|
const connect = () => {
|
|
|
|
if (ws) ws.close();
|
|
|
|
//@ts-ignore
|
|
|
|
ws = new WebSocket("ws://localhost:" + PORT + "/ws")
|
|
|
|
ws.onclose = () => !int && (int = setInterval(connect, 1000))
|
|
|
|
ws.onopen = () => { clearInterval(int); (int = false); console.log("dev ws open") };
|
|
|
|
ws.onmessage = () => window.location.reload();
|
|
|
|
}
|
|
|
|
connect();
|
|
|
|
}
|
|
|
|
|
2021-03-09 01:13:42 +01:00
|
|
|
export default app;
|