File tree Expand file tree Collapse file tree 6 files changed +25
-9
lines changed
Expand file tree Collapse file tree 6 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,24 @@ jobs:
2424 - name : Install wasm-pack
2525 run : |
2626 curl https://drager.github.io/wasm-pack/installer/init.sh -sSf | bash
27- # cargo install wasm-pack
2827
2928 - name : Build WASM
30- run : wasm-pack build --target web
29+ run : wasm-pack build --target web --no-pack --no-opt
30+
31+ - uses : actions/setup-node@v6
32+ with :
33+ node-version : 20
34+
35+ - name : Install npm dependencies and build
36+ run : |
37+ cp ../wasm/* .
38+ npm install
39+ npm run build
40+ working-directory : ./pkg
3141
3242 - name : Deploy to gh-pages
3343 uses : peaceiris/actions-gh-pages@v4
3444 with :
3545 github_token : ${{ secrets.GITHUB_TOKEN }}
36- publish_dir : ./pkg
46+ publish_dir : ./pkg/dist
3747 keep_files : false
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ use wasm_bindgen::prelude::*;
1616
1717/// Entry point for WASM
1818#[ cfg( target_arch = "wasm32" ) ]
19- #[ wasm_bindgen( start ) ]
19+ #[ wasm_bindgen]
2020pub fn start ( ) {
2121 run_app ( ) ;
2222}
Original file line number Diff line number Diff line change 22< html lang ="en ">
33< head >
44 < meta charset ="UTF-8 ">
5- < title > Bevy WASM Test</ title >
5+ < title > vizmat - Bevy WASM Test</ title >
66 < style > body { margin : 0 ; overflow : hidden; }</ style >
77</ head >
88< body >
99 < canvas id ="bevy-canvas "> </ canvas >
10- < script type ="module " src ="./test .js "> </ script >
10+ < script type ="module " src ="./index .js "> </ script >
1111</ body >
1212</ html >
Original file line number Diff line number Diff line change 1+ import init , { start } from "./vizmat.js" ;
2+
3+ async function main ( ) {
4+ await init ( ) ;
5+ start ( ) ;
6+ }
7+
8+ main ( ) ;
File renamed without changes.
Original file line number Diff line number Diff line change 3030 " material" ,
3131 " molecule"
3232 ],
33- "dependencies" : {
34- "vizmat" : " file:vizmat-0.1.0.tgz"
35- },
3633 "devDependencies" : {
3734 "vite" : " ^5.0.0" ,
3835 "vite-plugin-wasm" : " 3.5.0"
3936 },
4037 "scripts" : {
38+ "build" : " vite build" ,
4139 "dev" : " vite"
4240 }
4341}
You can’t perform that action at this time.
0 commit comments