unwasm icon indicating copy to clipboard operation
unwasm copied to clipboard

`resvg` compatibility

Open harlan-zw opened this issue 1 year ago • 4 comments

Environment

unwasm: 0.3.7 node: 18.18.0

Reproduction

https://stackblitz.com/edit/stackblitz-starters-rugrtg?file=package.json

Describe the bug

Resvg requires calling initWasm before using it in a WASM context. This function only takes the module as non-initialized module. Unwasm will always initialize the module.

Additional context

No response

Logs

No response

harlan-zw avatar Mar 08 '24 04:03 harlan-zw

Working on https://github.com/unjs/unwasm/pull/23, i hope it can help to support resvg-js sooner.

pi0 avatar Mar 14 '24 14:03 pi0

Updated: https://stackblitz.com/edit/stackblitz-starters-4rizt7?file=src%2Findex.ts,build.config.ts

pi0 avatar Mar 14 '24 16:03 pi0

Amazing, thank you! The demo looks good, I'll test further with Nuxt OG Image and make a new issue if there are any further issues.

harlan-zw avatar Mar 14 '24 23:03 harlan-zw

(keeping this open to not forget, might move to single tracker issue, finally we have to help upstream packages like resvg-js be ESM compatible)

pi0 avatar Mar 15 '24 10:03 pi0