()
| 21 | } |
| 22 | |
| 23 | const wasmPlugin = (): Plugin => ({ |
| 24 | name: "wasm", |
| 25 | async load(id) { |
| 26 | if (id.endsWith(".wasm")) { |
| 27 | const wasmBinary = await import(id) |
| 28 | |
| 29 | return ` |
| 30 | const wasmModule = new WebAssembly.Module(${wasmBinary.default}); |
| 31 | export default wasmModule; |
| 32 | ` |
| 33 | } |
| 34 | }, |
| 35 | }) |
| 36 | |
| 37 | const persistPortPlugin = (): Plugin => ({ |
| 38 | name: "write-port-to-file", |