Skip to main content
Module

x/aleph/plugins/wasm.ts

The Full-stack Framework in Deno.
Go to Latest
File
import type { LoaderPlugin } from '../types.ts'
const wasmLoader: LoaderPlugin = { type: 'loader', test: /.wasm$/, transform: (content: Uint8Array, path: string) => ({ code: ` const wasmBytes = new Uint8Array([${content.join(',')}]) const wasmModule = new WebAssembly.Module(wasmBytes) const { exports } = new WebAssembly.Instance(wasmModule) export default exports `, format: 'js' })}
export default wasmLoader