Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.

Latest commit

 

History

History
36 lines (34 loc) · 1013 Bytes

README.md

File metadata and controls

36 lines (34 loc) · 1013 Bytes

Rust loader for cargo-web/stdweb crates

In order to use this loader you need to install it by cloning this repository:

npm i --save cargo-web-loader

and then add it to your webpack config accordingly:

// Cargo web crate loader
{
    test: /Cargo.toml$/,
    loaders: [
      {
        loader: "cargo-web-loader",
        options: {
            flags: '',
            bin: false,
            release: true,
            verbose: false,
            features: ""
        }
    }],
},
// WebAssembly loader. For testing purposes
{
    test: /\.wasm$/,
    loader: require.resolve('file-loader'),
    options: {
        name: 'static/wasm/[name].[hash:8].[ext]'
    }
},

Finally you can import/require any Cargo.toml file and use it as documented in the cargo-web project.

Special thanks

Credit goes to dflemstr and his rust-native-wasm-loader which provided the groundwork for this loader.