🐛 load onigasm.wasm in jetbrains

This commit is contained in:
Nate Sesti 2024-02-14 20:21:04 -08:00
parent 3a39b4b28c
commit c54e2ce288
2 changed files with 9 additions and 1 deletions

View file

@ -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 //

View file

@ -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);