fix: use no-modules WASM target for simpler loading

This commit is contained in:
Accusys
2026-05-18 11:33:55 +08:00
parent e61ff88bf8
commit a1ac722b2f
8 changed files with 464 additions and 69 deletions
+18
View File
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head><title>WASM Test</title></head>
<body>
<h1>WASM Test Page</h1>
<div id="output">Loading...</div>
<script type="module">
try {
const mod = await WebAssembly.compileStreaming(
fetch('/doc-wasm/pkg/doc_wasm_bg.wasm')
);
document.getElementById('output').textContent = 'WASM compiled OK! Size: ' + mod.byteLength + ' bytes';
} catch(e) {
document.getElementById('output').textContent = 'ERROR: ' + e.message;
}
</script>
</body>
</html>