mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
ui: use vite
This commit is contained in:
15 files changed
+588
-31
No files matched your search
@@ -61,7 +61,7 @@ const onmessage = (msg) => {
|
||||
|
||||
const initWorkerMode = (endpoint) => {
|
||||
console.log('Messages: using SharedWorker');
|
||||
const worker = new SharedWorker('/messages-shared-worker.js', { name: 'HydroMessagesWorker' });
|
||||
const worker = new SharedWorker(new URL('./worker.ts?worker', import.meta.url), { name: 'HydroMessagesWorker' });
|
||||
worker.port.start();
|
||||
window.addEventListener('beforeunload', () => {
|
||||
worker.port.postMessage({ type: 'unload' });
|
||||
|
||||
Reference in new issue
Block a user