unwasm icon indicating copy to clipboard operation
unwasm copied to clipboard

Option for loading Wasm different ways

Open brendandahl opened this issue 8 months ago • 1 comments

Describe the feature

Inlining wasm is not always ideal do to the size increase and it also doesn't work well with extremely large files. It would be nice to have an option that controls how the wasm file is loaded.

The option name could be wasmLoadMode or wasmImportMethod where the options are 'inline', 'source-phase', 'fetch', 'cloudflare', '...?'. This setting would probably deprecate the esmImport setting.

Alternatively, there could be a targetEnv option like the current @rollup/plugin-wasm.

Any thoughts on how this should be implemented?

Additional information

  • [ ] Would you be willing to help implement this feature?

brendandahl avatar Apr 23 '25 22:04 brendandahl

Thanks for suggestion (sorry for my late replies, busy on h3 releases I will be back to help on unwasm triage and improvements ASAP)

pi0 avatar Apr 23 '25 22:04 pi0