Skip to content

Basic boilerplate configuration to import a local rust library in a vite based environment.

Notifications You must be signed in to change notification settings

Fedezable/react-rust-vite-ts-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Rust React Boilerplates

Basic boilerplate configuration to import a local rust library in a vite based environment

Prerequisites

You need to install npm and rust Installing npm Installing rust

1. Install wasm-pack

To build the package, we need an additional tool, wasm-pack. This helps compile the code to WebAssembly, as well as produce the right packaging for use in the browser.

cargo install wasm-pack

For more information visit mdn Compiling from Rust to WebAssembly

2. Install the project

After running npm install is also necessary to build the rust library due to interoperability between the vite project and the lib, imported as dependency and initialized before creating the react root node.

cd app
npm run install
npm run build:wasm

Run the project

You can run the project by simply using

npm run dev

Build the project

Building will recompile the rust library, and then the vite project.

npm run build

About

Basic boilerplate configuration to import a local rust library in a vite based environment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published