ui: seperate worker build

This commit is contained in:
undefined committed 2022-10-08 09:59:32 +08:00
1 parent 12bad8267a
commit 042acba3e7
6 files changed
+5 -3

No files matched your search

@@ -45,7 +45,7 @@ const endpoint = url.toString().replace('http', 'ws');
const initWorkerMode = () => {
console.log('Messages: using SharedWorker');
// @ts-ignore
const worker = new SharedWorker(new URL('./worker?inline', import.meta.url), { name: 'HydroMessagesWorker' });
const worker = new SharedWorker('/message-shared-worker.js', { name: 'HydroMessagesWorker' });
worker.port.start();
window.addEventListener('beforeunload', () => {
worker.port.postMessage({ type: 'unload' });