@wasm-tool/rust-loader
v0.0.4
Published
Webpack loader for Rust
Downloads
9
Readme
@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();
});