From 7dca7f64a75f0bc183102b7e3d919e3f353ac004 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Sat, 21 Dec 2024 20:32:11 -0300 Subject: [PATCH] fix cursed script import paths --- static/compiler.js | 2 +- static/worker.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/static/compiler.js b/static/compiler.js index 1388937..575778e 100644 --- a/static/compiler.js +++ b/static/compiler.js @@ -1,7 +1,7 @@ let compiler; export default async function initGleamCompiler() { - const wasm = await import("compiler/glistix_wasm.js"); + const wasm = await import("./compiler/glistix_wasm.js"); await wasm.default(); wasm.initialise_panic_hook(); if (!compiler) { diff --git a/static/worker.js b/static/worker.js index 03dfebd..c9b1490 100644 --- a/static/worker.js +++ b/static/worker.js @@ -17,8 +17,10 @@ console.log = (...args) => { }; async function loadProgram(js) { + // URL to worker.js ('base/worker.js') const url = new URL(import.meta.url); - url.pathname = ""; + // Remove 'worker.js', keep just 'base/' + url.pathname = url.pathname.substring(0, url.pathname.lastIndexOf("/") + 1); url.hash = ""; url.search = ""; const href = url.toString();