diff --git a/.gitignore b/.gitignore index e7cb983..4946890 100644 --- a/.gitignore +++ b/.gitignore @@ -60,6 +60,4 @@ typings/ # next.js build output .next -src/loader.js - .vscode diff --git a/src/loader.js b/src/loader.js new file mode 100644 index 0000000..4761bb1 --- /dev/null +++ b/src/loader.js @@ -0,0 +1,4 @@ +module.exports = function loadWasmBundle(bundle) { + const init = require(bundle.replace('_bg.wasm', '.js')); + return init(bundle).then(wasm => wasm); +};