@hadeeb/vite-plugin-wasm
v1.0.1
Published
Vite plugin to import wasm files in cloudflare workers
Readme
Vite plugin
Cloudflare workers supports importing .wasm files as WebAssembly.Module
import yogaWeb from "yoga-wasm-web";
import yogaWASM from "yoga-wasm-web/dist/yoga.wasm?module";
yogaWeb(yogaWASM);vite.config.ts
import { wasmEdgeModule } from "@hadeeb/vite-plugin-wasm";
export default defineConfig({
plugins: [wasmEdgeModule()],
});tsconfig.json
{
"compilerOptions": {
"types": ["vite/client", "@hadeeb/vite-plugin-wasm/types"]
}
}