@emnudge/rollup-plugin-wat
v0.3.0
Published
Import typed WAT with Rollup
Downloads
3
Maintainers
Readme
rollup-plugin-wat
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.
https://github.com/EmNudge/rollup-plugin-wat/assets/24513691/324ab107-8969-4e3d-8553-aeacdd028e9a
Install
using npm
npm install --save-dev @emnudge/rollup-plugin-wat
Usage
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()]
}
Credits
- 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