Compress the WASM file for even more space savings
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user