SystemJS plugin for loading and instanciating Web Assembly modules providing native like performances.
Should Work with
- lastest Firefox (52) and Chrome (57) releases
- lastest Opera via the
#enable-webassembly
flag - upcoming MS Edge via the "Experimental JavaScript Features flag"
You can generate Web Assembly modules from C/C++ using the EMScripten (aka emcc) Compiler
Via jspm or Babel + babel plugin es2015-modules-systemjs
import myApi from 'myWebAssemblyModule.wasm!';
myApi.myFunction();
const myApi = (await System.import('myWebAssemblyModule.wasm!')).default;
myApi.myFunction();
npm install systemjs-plugin-wasm
jspm install wasm
Create a map configuration to the plugin:
System.config({
map: {
'wasm': 'node_modules/systemjs-plugin-wasm/wasm.js'
}
})