emscripten-core / emscripten-core/emscripten
[Feature Request] Support building for both UMD/ESM
Open
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
When building wasm, I have to choose one between UMD and ESM for the generated JavaScript file, by either specifying the extension (.js vs .mjs) or using `-sEXPORT_ES6=1`. I want to build both of them but seems no way to do that.
Building it twice is not a working workaround because some number in the generated `ASM_CONSTS` table is different in 2 builds and the generated 2 JS files cannot use with one .wasm file.
Contributor guide
Assessment
This issue has not been assessed yet.