Menci / vite-plugin-wasm

Add WebAssembly ESM integration (aka. Webpack's `asyncWebAssembly`) to Vite and support `wasm-pack` generated modules.
MIT License
281 stars 16 forks source link

[Question] about wasm size #12

Closed katopz closed 1 year ago

katopz commented 1 year ago

In rust project after build I got web3_wasm.wasm = 1.2MB But after run-s clean && vite (yarn dev) to trigger the plugin tocopy wasm to node_modules. I got web3_wasm_bg.wasm = 706KB 😳 (which is good in case nothing break)

So the question is what (or who) make the size smaller? I try to peek a around the code but didn't see anything related to compression.

Thanks.

Menci commented 1 year ago

This plugin have nothing to do with the WASM file itself. I don't know.