From c54e2ce288d72dd45e21fefd7b73da8bbc3f5a3e Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 14 Feb 2024 20:21:04 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20load=20onigasm.wasm=20in=20jetbr?= =?UTF-8?q?ains?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/vscode/scripts/prepackage.js | 8 ++++++++ gui/src/main.tsx | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/extensions/vscode/scripts/prepackage.js b/extensions/vscode/scripts/prepackage.js index 4db78c7cb..756661d15 100644 --- a/extensions/vscode/scripts/prepackage.js +++ b/extensions/vscode/scripts/prepackage.js @@ -77,11 +77,19 @@ if (args[2] === "--target") { }); }); + // Put back index.html if (fs.existsSync(indexHtmlPath)) { fs.rmSync(indexHtmlPath, {}); } fs.copyFileSync("tmp_index.html", indexHtmlPath); fs.unlinkSync("tmp_index.html"); + + // Copy over other misc. files + fs.copyFileSync( + "../extensions/vscode/gui/onigasm.wasm", + path.join(intellijExtensionWebviewPath, "onigasm.wasm") + ); + console.log("[info] Copied gui build to Intellij extension"); // Then copy over the dist folder to the VSCode extension // diff --git a/gui/src/main.tsx b/gui/src/main.tsx index 9e46b8109..fe9196049 100644 --- a/gui/src/main.tsx +++ b/gui/src/main.tsx @@ -9,7 +9,7 @@ import "./index.css"; import { persistor, store } from "./redux/store"; (async () => { - const onigPath = (window as any).vscMediaUrl + "/onigasm.wasm"; + const onigPath = ((window as any).vscMediaUrl ?? "") + "/onigasm.wasm"; const resp = await fetch(onigPath); const onigWasm = await resp.arrayBuffer(); await loadWASM(onigWasm);