https://github.com/djedou/wasm_rust_react_setup
setup rust wasm for react
https://github.com/djedou/wasm_rust_react_setup
Last synced: 2 months ago
JSON representation
setup rust wasm for react
- Host: GitHub
- URL: https://github.com/djedou/wasm_rust_react_setup
- Owner: djedou
- Created: 2021-01-15T08:42:18.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-15T14:08:11.000Z (over 4 years ago)
- Last Synced: 2025-01-29T04:26:41.692Z (4 months ago)
- Language: JavaScript
- Size: 195 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# wasm_rust_react_setup
rust for Front-end logic
react for Front-end presentation## clone or download this repository
```
git clone [email protected]:djedou/wasm_rust_react_setup.git
```
## switch into windows or linux
```
cd windows
```
## create react app
```
path_to/setup.bat react_app_name
```
## update scripts in react_app_name/package.json
```
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"build-native-dev": "wasm-pack build ./src/native --target bundler --out-dir ./build --dev",
"build-native-release": "wasm-pack build ./src/native --target bundler --out-dir ./build --release",
"test": "react-app-rewired test",
"eject": "react-scripts eject"
}
```
## build rust code when ever needed
```
cd react_app_name
npm run build-native-dev
npm run start
```