Skip to content

Commit 178580a

Browse files
authored
feat: support quasar (#157)
1 parent 25222d7 commit 178580a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ dist
107107

108108
# Stores VSCode versions used for testing VSCode extensions
109109
.vscode-test
110-
110+
basepc
111111
# yarn v2
112112
.yarn/cache
113113
.yarn/unplugged

src/api/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ function initWorker() {
3333
// use for webpack5+ or vite
3434
const isViteEnvironment = import.meta.url.includes('.vite/deps');
3535
const isNuxtEnvironment = import.meta.url.includes('_nuxt/node_modules');
36+
const isQuasarEnvironment = import.meta.url.includes('.q-cache');
3637
const isSupportModuleWorker = supportsModuleWorkers();
37-
3838
let workerUrl = isSupportModuleWorker
3939
? new URL('worker.js', import.meta.url)
4040
: new URL('worker-legacy.js', import.meta.url);
@@ -50,6 +50,12 @@ function initWorker() {
5050
'@openim/wasm-client-sdk/lib'
5151
) as unknown as URL;
5252
}
53+
if (isQuasarEnvironment) {
54+
workerUrl = workerUrl.href.replace(
55+
/\.q-cache\/dev-spa\/[^/]+\/deps/,
56+
'@openim/wasm-client-sdk/lib'
57+
) as unknown as URL;
58+
}
5359
worker = new Worker(workerUrl, {
5460
type: isSupportModuleWorker ? 'module' : 'classic',
5561
});

0 commit comments

Comments
 (0)