A Rollup plugin for directly importing "WebAssembly Text Format" files.
Imports are dynamically typed via creation of a local .d.ts
file next to the .wat
source.
demo.mp4
using npm
npm install --save-dev @emnudge/rollup-plugin-wat
Add the plugin to your plugins
array in your rollup.config.js
file.
import { wat } from '@emnudge/rollup-plugin-wat';
export default {
// ...some other config
plugins: [wat()]
}
- General package setup copied from @rollup/plugin-wasm.
- wat2wasm npm package from AssemblyScript for creating wasm from wat files
- webassembly.js for the AST used for extracting type information