2 Commits
Author SHA1 Message Date
alu b0aacd5f9c use -n and -9 in gzip 2026-09-09 16:51:35 +00:00
alu 57296ed303 use gzip to reduce tx bytes to ~600K 2026-09-08 22:01:21 +00:00
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -5,11 +5,12 @@ build: clean
mkdir -p dist mkdir -p dist
cp wfa.js dist/wfa.js cp wfa.js dist/wfa.js
GOOS=js GOARCH=wasm CGO_ENABLED=0 go build -ldflags="-s -w" -trimpath -o dist/wfa.wasm . GOOS=js GOARCH=wasm CGO_ENABLED=0 go build -ldflags="-s -w" -trimpath -o dist/wfa.wasm .
gzip -n -9 dist/wfa.wasm
clean: clean:
@echo "======================== Cleaning Project ======================" @echo "======================== Cleaning Project ======================"
go clean go clean
rm -f dist/wfa.wasm dist/wfa.js cover.prof cpu.prof mem.prof test.test rm -f dist/* cover.prof cpu.prof mem.prof test.test
test: test:
@echo "======================== Running Tests =========================" @echo "======================== Running Tests ========================="
+1 -1
View File
@@ -4,7 +4,7 @@
<script src="wfa.js" type="module"></script> <script src="wfa.js" type="module"></script>
<script type="module"> <script type="module">
import wfaInit from "./wfa.js"; import wfaInit from "./wfa.js";
wfaInit("dist/wfa.wasm"); wfaInit("dist/wfa.wasm.gz");
window.addEventListener("DOMContentLoaded", () => { window.addEventListener("DOMContentLoaded", () => {
document.querySelector("#submit").addEventListener("click", () => { document.querySelector("#submit").addEventListener("click", () => {
a = document.querySelector("#a").value a = document.querySelector("#a").value