Fixed imports except BrowserFS

This commit is contained in:
Felix Kaspar
2023-10-24 01:00:09 +02:00
parent 368d742d41
commit 8d032a2cf2
6 changed files with 1989 additions and 4799 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,3 @@
// TODO: Uses the BrowserFS import, needs to be changed for serverside
let wasmLocation = "/wasm/";
let fs;
@@ -8,7 +6,7 @@ let Buffer;
configureFs();
loadWasm();
function configureFs() {
async function configureFs() {
BrowserFS.configure(
{
fs: "InMemory",
@@ -28,10 +26,7 @@ function configureFs() {
}
function loadWasm() {
const script = document.createElement("script");
script.src = wasmLocation + "/wasm_exec.js";
script.async = true;
document.body.appendChild(script);
import("../../../server-node/public/wasm/wasm_exec.js");
}
const runWasm = async (param) => {

View File

@@ -1,5 +1,3 @@
// TODO: Uses the BrowserFS import, needs to be changed for serverside
import { WasmFs } from '@wasmer/wasmfs';
import path from "path";