Skip to content

wasm-tool/wasi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wasm-tool/wasi

Import WebAssembly modules that expose the WebAssembly System Interface (WASI).

Installation

npm install --save-dev @wasm-tool/wasi

In JavaScript:

import("./example.wasm")
  .then(exports => {
      exports.someFunc();
   });

Usage: webpack

Include the following rule in your webpack configuration:

{
  // ...
  module: {
    rules: [
      {
        test: /\.wasm/,
        type: "javascript/auto",
        use: {
          loader: "@wasm-tool/wasi"
        }
      }
    ]
  }
  // ...
}

We need to set the type to JavaScript to bypass webpack's wasm support (as a workaround, for now). Which will also prevent the loading to work correclty in non-web environements.

About

Import WebAssembly modules that expose the WebAssembly System Interface (WASI).

Resources

License

Stars

Watchers

Forks

Packages

No packages published