openscad-wasm
openscad-wasm copied to clipboard
How small can I get this?
Hopefully should be reasonable simple to answer - I'm trying to build a proof-of-concept hardware demo that implements a mass storage device with a portable OpenSCAD compiler. No UI, fonts, etc., are required, just a single .HTML file where you open it, click a button, and it spits out an STL from a hardcoded SCAD model. Since I'm not assuming the presence of a web server, I can't fetch OpenSCAD from a CDN because of CORS policy, and anyway I want it to work offline. My target for the entire package is 2 megabytes, as that's the size of the NOR flash I built the hardware with. I see that openscad.wasm can LZMA compress down to 1.7 MBytes, and I imagine there's some way to unpack that blob on page load. So it all seems possible. But I'd like a bit more headroom. What are the build-time flags I should be switching off to get the size down even further?