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

TilBlechschmidt-ProjectGraveyard/cargo-web-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Releases

No releases published

Packages

No packages published