chore: re-enable wasm
continuous-integration/drone/push Build is running Details

This commit is contained in:
Kieran 2023-11-20 19:28:22 +00:00
parent 7c8fff97ce
commit 377061e9d6
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
3 changed files with 5 additions and 5 deletions

View File

@ -25,3 +25,4 @@ yarn-error.log*
.idea
dist/
dev-dist/

View File

@ -3,7 +3,7 @@ import "@szhsin/react-menu/dist/index.css";
import "./fonts/inter.css";
import { compress, expand_filter, flat_merge, get_diff, pow, default as wasmInit } from "@snort/system-wasm";
import WasmPath from "@snort/system-wasm/pkg/system_wasm_bg.wasm?init";
import WasmPath from "@snort/system-wasm/pkg/system_wasm_bg.wasm";
import { StrictMode } from "react";
import * as ReactDOM from "react-dom/client";
@ -25,7 +25,7 @@ import PowWorkerURL from "@snort/system/src/pow-worker.ts?worker&url";
import { SnortContext } from "@snort/system-react";
import { removeUndefined, throwIfOffline } from "@snort/shared";
import React, { lazy, Suspense } from "react";
import { lazy, Suspense } from "react";
const NetworkGraph = lazy(() => import("@/Pages/NetworkGraph"));
@ -88,8 +88,7 @@ export class WasmPowWorker implements PowMiner {
}
}
//const hasWasm = "WebAssembly" in globalThis;
const hasWasm = false;
const hasWasm = "WebAssembly" in globalThis;
const DefaultPowWorker = hasWasm ? undefined : new PowWorker(PowWorkerURL);
export const GetPowWorker = () => (hasWasm ? new WasmPowWorker() : unwrap(DefaultPowWorker));

View File

@ -23,7 +23,7 @@ export default defineConfig({
filename: "dist/stats.html",
}),
],
assetsInclude: ["**/*.md"],
assetsInclude: ["**/*.md","**/*.wasm"],
resolve: {
alias: {
"@": "/src",