Skip to content

Commit

Permalink
Remove workaround for import.meta.url in worker
Browse files Browse the repository at this point in the history
  • Loading branch information
cedeber committed Sep 28, 2021
1 parent ebc23ff commit 798d290
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app-src/worker.ts
@@ -1,6 +1,4 @@
import init, { async_add } from "../pkg/primio";
// Workaround because Vite is using window.location in Web Workers
import wasm from "../pkg/primio_bg.wasm?url";
import * as extern from "./extern";

// Declare ctx as Worker and not as Window
Expand All @@ -15,7 +13,7 @@ ctx.addEventListener("message", async (event) => {
const { a, b } = event.data;

// Workaround because the path is relative to the js file (in assets) and not to the root.
await init(wasm);
await init();

// Async
const result = await async_add(a, b);
Expand Down

0 comments on commit 798d290

Please sign in to comment.