wasm-loader
Version:
Webpack loader for WASM
21 lines (17 loc) • 373 B
JavaScript
// This file will not run on it's own
const {
Module,
instantiate,
Memory,
Table
} = WebAssembly;
const WebAssemblyModule = function(deps = {
'global': {},
'env': {
'memory': new Memory({initial: 10, limit: 100}),
'table': new Table({initial: 0, element: 'anyfunc'})
}
}) {
return instantiate(buffer, deps);
}
module.exports = WebAssemblyModule;