Skip to content

Comments

Emscripten: Add option for Modern ES6 modules#1468

Merged
farindk merged 1 commit intostrukturag:masterfrom
dukesook:es6
Feb 19, 2025
Merged

Emscripten: Add option for Modern ES6 modules#1468
farindk merged 1 commit intostrukturag:masterfrom
dukesook:es6

Conversation

@dukesook
Copy link
Contributor

@dukesook dukesook commented Feb 18, 2025

The -sEXPORT_ES6 flag adds the following export statement to libheif.js:

export default libheif;

This allows libheif.js to be imported with the modern import keyword.

I also believe this setting should be on by default since ESM is the standard going forward.
The test case in test-javascript.js uses require() instead of import.

@farindk farindk merged commit 00f2744 into strukturag:master Feb 19, 2025
35 checks passed
@farindk
Copy link
Contributor

farindk commented Feb 19, 2025

Yes, I think this should be explicitly enabled (with USE_ES6) because it appears to be not backwards compatible. If I see this correctly, EXPORT_ES6 also enables MODULARIZE, which changes how the functions are exported.

@dukesook dukesook deleted the es6 branch February 19, 2025 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants