From 42f553658065aceb4e1fd8a78bc5bcb9da06c022 Mon Sep 17 00:00:00 2001 From: Paula Date: Sun, 15 Mar 2026 13:52:17 -0300 Subject: [PATCH] Fix worker harded code hash --- build.ts | 18 ++++++++++-------- client/index.html | 2 +- client/systems/rendering/dimension.ts | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/build.ts b/build.ts index 9c4c81c..2186b5a 100644 --- a/build.ts +++ b/build.ts @@ -5,7 +5,7 @@ const BUILD_FOLDER = "build"; function clear_folder() { Deno.removeSync(BUILD_FOLDER, { recursive: true }); - Deno.mkdir(BUILD_FOLDER); + Deno.mkdirSync(BUILD_FOLDER); } async function build_fonts() { @@ -37,9 +37,9 @@ async function build_fonts() { } ctx.putImageData(image_data, 0, 0); - Deno.mkdir(`${BUILD_FOLDER}/assets/fonts`); + Deno.mkdirSync(`${BUILD_FOLDER}/assets/fonts`); Deno.writeFileSync(`${BUILD_FOLDER}/assets/fonts/m6x11.png`, canvas.toBuffer()); - copy("assets/fonts/m6x11.fnt", `${BUILD_FOLDER}/assets/fonts/m6x11.fnt`); + await copy("assets/fonts/m6x11.fnt", `${BUILD_FOLDER}/assets/fonts/m6x11.fnt`); } function next_power_of_two(value: number): number { @@ -100,7 +100,7 @@ async function build_atlas_from_folder(folder: string) { async function build_sprites() { for (const entry of Deno.readDirSync("assets/sprites")) { if (entry.name.endsWith(".png")) { - copy(`assets/sprites/${entry.name}`, `${BUILD_FOLDER}/assets/sprites/${entry.name}`); + await copy(`assets/sprites/${entry.name}`, `${BUILD_FOLDER}/assets/sprites/${entry.name}`); } else if (entry.isDirectory) { await build_atlas_from_folder(`assets/sprites/${entry.name}`); } @@ -108,21 +108,23 @@ async function build_sprites() { } async function build_assets() { - Deno.mkdir(`${BUILD_FOLDER}/assets`, { recursive: true }); - copy("assets/ASSETS.md", `${BUILD_FOLDER}/assets/ASSETS.md`); + Deno.mkdirSync(`${BUILD_FOLDER}/assets`, { recursive: true }); + await copy("assets/ASSETS.md", `${BUILD_FOLDER}/assets/ASSETS.md`); build_fonts(); - Deno.mkdir(`${BUILD_FOLDER}/assets/sprites`, { recursive: true }); + Deno.mkdirSync(`${BUILD_FOLDER}/assets/sprites`, { recursive: true }); await build_sprites(); } async function build_client() { const _result = await Deno.bundle({ - entrypoints: ["./client/index.html", "./client/systems/rendering/chunk_mesh_worker.ts"], + entrypoints: ["./client/main.ts", "./client/systems/rendering/chunk_mesh_worker.ts"], outputDir: `${BUILD_FOLDER}/client`, platform: "browser", minify: false, + keepNames: true, }); + await copy("./client/index.html", `${BUILD_FOLDER}/client/index.html`); } async function build() { diff --git a/client/index.html b/client/index.html index 2a1b1d3..f905f28 100644 --- a/client/index.html +++ b/client/index.html @@ -19,6 +19,6 @@ - + diff --git a/client/systems/rendering/dimension.ts b/client/systems/rendering/dimension.ts index a9cdc7f..9fb1ed9 100644 --- a/client/systems/rendering/dimension.ts +++ b/client/systems/rendering/dimension.ts @@ -18,7 +18,7 @@ import { AssetManager } from "../../assets.ts"; let gdimension: Dimension; -const worker = new Worker(new URL("./systems/rendering/chunk_mesh_worker-AYRYRGPW.js", import.meta.url), { +const worker = new Worker(new URL("./systems/rendering/chunk_mesh_worker.js", import.meta.url), { type: "module", });