35 lines
920 B
Makefile
35 lines
920 B
Makefile
wasm: && clean-wasm-pack
|
|
# build with wasm-pack
|
|
wasm-pack build --target web
|
|
|
|
wasm-dev: && clean-wasm-pack
|
|
wasm-pack build --dev --target web
|
|
|
|
clean-wasm-pack:
|
|
# delete cruft from wasm-pack
|
|
rm pkg/.gitignore pkg/package.json pkg/README.md
|
|
rm -rf pkg/snippets
|
|
# fix imports of rudus.js
|
|
cp pkg/rudus.js pkg/rudus.js.backup
|
|
echo 'import { io } from "./worker.js"' > pkg/rudus.js
|
|
cat pkg/rudus.js.backup | tail -n+2>> pkg/rudus.js
|
|
rm pkg/rudus.js.backup
|
|
|
|
from_branch := `git branch --show-current`
|
|
git_status := `git status -s`
|
|
|
|
release:
|
|
echo {{ if git_status == "" {"git status ok"} else {error("please commit changes first")} }}
|
|
just wasm
|
|
git commit -am "release build"
|
|
git checkout release
|
|
git merge {{from_branch}}
|
|
git push
|
|
git checkout {{from_branch}}
|
|
|
|
serve:
|
|
open http://localhost:8080/index.html && miniserve pkg
|
|
|
|
default:
|
|
@just --list
|