Menci / vite-plugin-wasm

Add WebAssembly ESM integration (aka. Webpack's `asyncWebAssembly`) to Vite and support `wasm-pack` generated modules.
MIT License
281 stars 16 forks source link

Unknown file extension ".wasm" #56

Open RobinClowers opened 6 months ago

RobinClowers commented 6 months ago

Thanks for this package! I'm on the latest version, 3.3.0, but I'm getting the Unknown file extension ".wasm" for <package> error.

This code is running in Vitest, maybe that has something to do with it?

Versions: vite 5.0.10 vitest 1.3.1 node 18.17.1 vite-plugin-wasm 3.3.0

I also tried:

optimizeDeps: {
  exclude: [<package>]
}

but that didn't appear to make any difference.

RobinClowers commented 1 month ago

I've just migrated from wepack to vite (I was just using vite in test before) and I can confirm my wasm modules work just fine in development, so it does appear to be something specific to vitest or my test config.