workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🚀 Feature Request: Support for ".wasm" and other data blobs imports for `vite-plugin-cloudflare`

Open kumardeo opened this issue 1 year ago • 2 comments

Describe the solution

It would be great if vite-plugin-cloudflare resolves esm .wasm, .bin imports just like wrangler does. For example:

// src/worker.ts
import photonWasmModule from "./photon.wasm";
import fontData from "./font.ttf.bin";

It should also resolve these imports if they are used in a package for example @cf-wasm/photon.

kumardeo avatar Feb 04 '25 09:02 kumardeo

Thanks for the request! Wasm support is coming very soon (#8031) and support for more general rules will be added in a follow up PR.

jamesopstad avatar Feb 05 '25 09:02 jamesopstad

Thanks 🙏! I am exploring vite-plugin-cloudflare, works great but I found some behaviours which are different from wrangler. Will create separate issues for them. Thanks again for this plugin ⛅.

kumardeo avatar Feb 05 '25 10:02 kumardeo