Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ESM wasm build #133

Merged
merged 1 commit into from
Aug 31, 2024
Merged

Conversation

hyzyla
Copy link
Contributor

@hyzyla hyzyla commented Aug 31, 2024

I made a mistake in the ES WebAssembly build by using the flag -sWASM=0. I initially thought this flag would simply prevent the generation of a WebAssembly binary, but I was wrong. Instead, it embedded everything into a large JavaScript file using wasm2js. In this PR, I removed that flag, and now it generates two WebAssembly files:

drwxr-xr-x  7 hyzyla  staff      224 Aug 31 13:11 .
drwxr-xr-x  6 hyzyla  staff      192 Aug 31 13:11 ..
-rw-r--r--  1 hyzyla  staff    46380 Aug 31 13:11 index.html
-rw-r--r--  1 hyzyla  staff   159408 Aug 31 13:11 pdfium.esm.js
-rwxr-xr-x  1 hyzyla  staff  3899985 Aug 31 13:11 pdfium.esm.wasm
-rw-r--r--  1 hyzyla  staff   159451 Aug 31 13:11 pdfium.js
-rwxr-xr-x  1 hyzyla  staff  3899985 Aug 31 13:11 pdfium.wasm

Both pdfium.wasm and pdfium.esm.wasm are identical, but the pdfium.esm.js module links to pdfium.esm.wasm, and pdfium.js links to pdfium.wasm. I'm not sure if it's currently possible to configure em++ to point to the same file for both, but I think this solution is acceptable for now.

@paulocoutinhox paulocoutinhox merged commit 737d2b2 into paulocoutinhox:master Aug 31, 2024
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