Skip to content

Commit

Permalink
Use New Crate Name in WASM Build
Browse files Browse the repository at this point in the history
WASM build was failing because we renamed the crate to punchy.
  • Loading branch information
zicklag committed Jul 13, 2022
1 parent 5ae55f7 commit 772591a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ build:

build-release:
cargo build --release
strip target/release/littlefighter2
strip target/release/punchy

build-web:
cargo build --target wasm32-unknown-unknown
wasm-bindgen --out-dir target/wasm --target web target/wasm32-unknown-unknown/debug/littlefighter2.wasm
wasm-bindgen --out-dir target/wasm --target web target/wasm32-unknown-unknown/debug/punchy.wasm
cat wasm_resources/index.html | sed "s/\$BASEPATH//g" > target/wasm/index.html
mkdir -p target/wasm
cp -r assets target/wasm/

build-release-web basepath='':
cargo build --target wasm32-unknown-unknown --release
wasm-bindgen --out-dir target/wasm-dist --no-typescript --target web target/wasm32-unknown-unknown/release/littlefighter2.wasm
wasm-bindgen --out-dir target/wasm-dist --no-typescript --target web target/wasm32-unknown-unknown/release/punchy.wasm
cat wasm_resources/index.html | sed "s/\$BASEPATH/$(printf {{basepath}} | sed 's/\//\\\//g')/g" > target/wasm-dist/index.html
cp -r assets target/wasm-dist/

Expand Down
2 changes: 1 addition & 1 deletion wasm_resources/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
})();
</script>
<script type="module">
import init from "$BASEPATH/littlefighter2.js";
import init from "$BASEPATH/punchy.js";
init();
</script>
</body>
Expand Down

0 comments on commit 772591a

Please sign in to comment.