0.0.4 • Published 6 years ago

@wasm-tool/rust-loader v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

@wasm-tool/rust-loader

Webpack loader for Rust

Installation

yarn add --dev @wasm-tool/rust-loader

wasm-pack

We expect wasm-pack to be in your $PATH. See installation here.

Usage

Add the loader in your webpack.config.js:

module.exports = {
  // ...

  module: {
    rules: [
      {
        test: /Cargo.toml$/,
        loader: "@wasm-tool/rust-loader"
      }
    ]
  },

  // ...
};

and then import your crate:

import("./path/to/your/Cargo.toml").then(module => {
  module.run();
});