emscripten-core / emscripten-core/emscripten

[Feature Request] Support building for both UMD/ESM

Open
#21,899 21 comments 3 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.