feat: add origin to names of sharedworkers if provided

This commit is contained in:
Percs 2024-10-15 19:17:01 -05:00
parent 7233c60ac0
commit d0046964e0
2 changed files with 52 additions and 32 deletions

View file

@ -176,8 +176,8 @@ export class ScramjetClient {
const module = context(key);
if (!key.endsWith(".ts")) continue;
if (
(key.startsWith("./dom/") && "window" in self) ||
(key.startsWith("./worker/") && "WorkerGlobalScope" in self) ||
(key.startsWith("./dom/") && "window" in this.global) ||
(key.startsWith("./worker/") && "WorkerGlobalScope" in this.global) ||
key.startsWith("./shared/")
) {
modules.push(module);