You must have node (and npm) installed.
npx -y create vite@latest wasm-rust-react -- --template react-tsInstall rust related tools using the setup script:
bash setup.shCreate new rust lib:
cargo new rust-libs --lib
cd rust-libs
cargo add wasm-bindgenChange crate-type in Cargo.toml and add rust byproducts in .gitignore.
[lib]
crate-type = ["cdylib"]Build the rust libs:
wasm-pack build --target webInstall/add package to npm:
npm i ./rust-libs/pkgOr add "rust-libs": "file:rust-libs/pkg" to package.json dependencies, and
run:
npm iStart development server:
npm startTo update rust dependencies:
cargo install cargo-update --features vendored-openssl
cargo install-update -a