rollup-plugin-wasm-module
A Rollup plugin that wraps
wasm-module-preprocessor
.
Install
npm install --save-dev rollup-plugin-wasm-module
Usage
rollup-plugin-wasm-module
by default loads wasm modules asynchronously, and
takes an optional importObject
. All wasm modules are validated on build, so
that there is no need for runtime testing and beyond just validating wasm
modules, the size of the wasm module is checked too.
Async
file.js
; { const instance: exports: factorial = undefined } } } = await ; return ;}
rollup.config.js
; plugins: ;
Sync
file.js
; { const exports: factorial = undefined } } = ; return ;}
rollup.config.js
; plugins: ;
Options
All options are defined by and are passed directly to
wasm-module-preprocessor
; check its documentation
for more a in-depth explanation.