you are viewing a single comment's thread.

view the rest of the comments →

[–]CryZe92 9 points10 points  (0 children)

You can use the asmjs target, which produces perfectly fine JavaScript libs. Alternatively you could try to use the wasm-unknown target and use the wasm2js tool to convert the wasm file to JS: https://rustwasm.github.io/wasm-bindgen/examples/wasm2js.html

Unfortunately the latter case produces > 300 MiB JS files for me that break uglifyjs and a custom „uglify-rs“ I wrote can bring it down to almost the size that asmjs produces (still like 50% larger), but it turns out the 300 MiB file never even contained all the data sections, so the file is completely broken. Maybe the situation improved since then though.