Compress the WASM file for even more space savings

This commit is contained in:
2025-11-15 15:16:37 -06:00
parent 3639122e54
commit be83be1a7b
2 changed files with 12 additions and 7 deletions

View File

@@ -98,7 +98,11 @@
<script type="module">
import init from './asteroids.js'
init().catch((error) => {
let compressed = await fetch("./asteroids_bg.wasm.gz")
let wasm_stream = compressed.body.pipeThrough(new DecompressionStream("gzip"))
let blob = await new Response(wasm_stream).blob();
init(await blob.arrayBuffer()).catch((error) => {
if (!error.message.startsWith("Using exceptions for control flow, don't mind me. This isn't actually an error!")) {
throw error;
}