emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.62k stars 3.28k forks source link

.asm.js file emitted with `-s WASM=1` is not minified at all #5271

Closed saschanaz closed 5 years ago

saschanaz commented 7 years ago

Compiling with -s WASM=1 -s BINARYEN_METHOD='native-wasm,asmjs' emits asm.js file with no minification even with -O2. It should be minified somehow.

kripken commented 7 years ago

This hasn't been a priority since such a build is a compromise build anyhow, so it's not fully optimized. It's useful mainly for debugging.

saschanaz commented 7 years ago

I want to use it as an automatic fallback on earlier browsers (including MSEdge 15 😅). My makefile already has been generating a compromise build because of -s ALLOW_MEMORY_GROWTH=1 so I don't bother with it.

kripken commented 7 years ago

I see. Seems reasonable to do this I guess.

We should probably show a warning at compile time though, in addition to the documentation, about the downsides of compromise builds.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.