mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-15 12:58:45 +00:00
fix(wasm): support loading webassembly again
Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
@@ -51,6 +51,13 @@ export default function process(
|
|||||||
wasmFeatures = "simd128";
|
wasmFeatures = "simd128";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let module = undefined;
|
||||||
|
|
||||||
|
if (isWASMSupported) {
|
||||||
|
module = await fetch(u(`${basePrefix}/.within.website/x/cmd/anubis/static/wasm/${wasmFeatures}/${algorithm}.wasm?cacheBuster=${version}`))
|
||||||
|
.then(x => WebAssembly.compileStreaming(x));
|
||||||
|
}
|
||||||
|
|
||||||
const webWorkerURL = `${basePrefix}/.within.website/x/cmd/anubis/static/js/worker/${worker}.mjs?cacheBuster=${version}`;
|
const webWorkerURL = `${basePrefix}/.within.website/x/cmd/anubis/static/js/worker/${worker}.mjs?cacheBuster=${version}`;
|
||||||
|
|
||||||
const workers: Worker[] = [];
|
const workers: Worker[] = [];
|
||||||
@@ -103,6 +110,7 @@ export default function process(
|
|||||||
nonce: i,
|
nonce: i,
|
||||||
threads,
|
threads,
|
||||||
algorithm,
|
algorithm,
|
||||||
|
module,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user