mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
ui: seperate worker build
This commit is contained in:
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' });
|
||||
|
||||
Reference in new issue
Block a user