()
| 26 | }; |
| 27 | |
| 28 | const bootDev = () => { |
| 29 | loadCSS(`${DEV_ORIGIN}/build/main.css`); |
| 30 | loadScript(`${DEV_ORIGIN}/build/main.js`); |
| 31 | |
| 32 | const wsProto = DEV_PROTO === "https" ? "wss" : "ws"; |
| 33 | const connectWS = () => { |
| 34 | let ws; |
| 35 | try { |
| 36 | ws = new WebSocket(`${wsProto}://${DEV_HOST}:${DEV_PORT}`); |
| 37 | } catch { |
| 38 | setTimeout(connectWS, 1000); |
| 39 | return; |
| 40 | } |
| 41 | ws.onmessage = ({ data }) => { |
| 42 | if (data === "reload") location.reload(); |
| 43 | }; |
| 44 | ws.onclose = () => setTimeout(connectWS, 1000); |
| 45 | ws.onerror = () => {}; |
| 46 | }; |
| 47 | connectWS(); |
| 48 | }; |
| 49 | |
| 50 | const bootProd = () => { |
| 51 | loadCSS("./build/main.css"); |
no test coverage detected