vite-plugin-wasm icon indicating copy to clipboard operation
vite-plugin-wasm copied to clipboard

can we add an option control whether generated code using top-level-await?

Open Shana-AE opened this issue 10 months ago • 0 comments

Hello, thank you for your great work first. Since top-level-await has not been well supported now. and the using vite-plugin-top-level-await to handle compatibility problem may cause async contamination which may introduce hard-to-debug unwanted problem as I mentioned below. https://github.com/Menci/vite-plugin-top-level-await/issues/64

Maybe it's a good idea to provide an option to decide whether produce top-level-await code or produce promise module and let user to handle the wasm async behavior instead of using vite-plugin-top-level-await with async contamination?

Shana-AE avatar Feb 11 '25 08:02 Shana-AE