This guide provides a detailed walkthrough on how to link the saito-lite-rust repository to the saito-wasm locally via the saito-js wrapper. This process leverages the npm link command.
Note: The saito-lite-rust (SLR) repository by default comes bundled with the saito-js library in its package.json. If, however, you wish to manually establish this linkage, the instructions below will guide you.
Before starting, ensure:
-
Node.js and npm are installed.
-
saito-lite-rust, saito-js, and saito-wasm repositories are cloned on your local machine.
If you're using a Mac with the M1 chip, follow these additional steps:
export CC=/opt/homebrew/opt/llvm/bin/clang
brew install llvm
npm i -g wasm-pack
CC=/opt/homebrew/opt/llvm/bin/clang AR=/opt/homebrew/opt/llvm/bin/llvm-ar wasm-pack build --target web --out-dir wasm_build/deps/pkg/
npm install
npm run build
npm link
npm install
npm link saito-wasm
npm run build
- Navigate into the dist folder in the saito-js directory
- Run link command
npm link
npm install
npm link saito-js
npm run go