From 7e194e86e374d0c034df1da40415ad148bb0d3d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Ku=C4=8Dera?= Date: Sat, 7 Sep 2024 14:37:50 +0200 Subject: [PATCH] fix: module --- dist/index.js | 2 +- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 0307f39..c92f8fe 100644 --- a/dist/index.js +++ b/dist/index.js @@ -343,7 +343,7 @@ const loadWorker = async (url) => { throw new Error(`Failed to fetch worker`); } const script = await response.text(); - return new Worker(URL.createObjectURL(new Blob([script], { type: "application/javascript" }))); + return new Worker(URL.createObjectURL(new Blob([script], { type: "application/javascript" })), { type: "module" }); }; const worker = wrap(await loadWorker(new URL("./worker.js", import.meta.url))); const krak = { diff --git a/src/index.ts b/src/index.ts index 0c50ba3..6c511d9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,7 +12,7 @@ const loadWorker = async (url: URL): Promise => { const script = await response.text(); - return new Worker(URL.createObjectURL(new Blob([script], { type: "application/javascript" }))); + return new Worker(URL.createObjectURL(new Blob([script], { type: "application/javascript" })), { type: "module" }); }; const worker = wrap(await loadWorker(new URL("./worker.js", import.meta.url)));