Is there a list of all the optimisations that dfx build is applying to reduce the size of the produced wasm file?
When I build with dfx build I receive a wasm size of around 1.9 MB but if I run the same build with cargo build, I end up at 3.7 MB (which is too large to upload to IC as >2MB). How can I find all the optimisations that dfx is applying?
dfx uses ic-wasm after cargo build and adds the .did file to the custom sections. I don’t think it does anything else
ic-wasm repo
https://github.com/dfinity/ic-wasm/
in II custom build they use ic-wasm as following
https://github.com/dfinity/internet-identity/blob/0b58ec9dcba3a7ff73a51d5fa1851cb3205c3822/scripts/build#L134