Build modularized JS toolkit with support for -s EXPORT_ES6#3174
Merged
lpugin merged 5 commits intorism-digital:developfrom Dec 22, 2022
Merged
Build modularized JS toolkit with support for -s EXPORT_ES6#3174lpugin merged 5 commits intorism-digital:developfrom
-s EXPORT_ES6#3174lpugin merged 5 commits intorism-digital:developfrom
Conversation
Contributor
|
Thanks!
Could you try to add this to the cmake file (in |
Contributor
Author
|
Thanks, I added your snippet into CMakeLists.txt. Additionally I improved error handling in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #3168.
Recently there was some progress in emscripten to support ECMAScript modules and emscripten-core/emscripten#11792 was implemented in emscripten-core/emscripten#17915. This means that since
em++v3.1.27 we can use theEXPORT_ES6flag to generate an ESM build of the emscripten module instead of a CommonJS module (that can be imported with ESM).Is there anything I can add to force usage of em++ v3.1.27?
I did some tests an even without 3bca155 everything did work just fine in my project. But adding
mjsas file extension will probably be the safer method to ensure the verovio-module will be used with ESM. For other usage you can still useverovio-toolkit-wasm.jswith CommonJS due to the UMD format.Probably this won't fix all cases when using verovio with bundlers (see this comment emscripten-core/emscripten#11792 (comment)) but it should still improve ESM support.