Switch to wasm bindgen instead of trunk
parent
c7a137c58d
commit
5c1b9e4395
@ -1,7 +1,27 @@
|
|||||||
web/trees:
|
web/trees:
|
||||||
mkdir -p dist/trees
|
mkdir -p dist/trees
|
||||||
trunk build --release true trees.html --dist dist/trees
|
|
||||||
ln -sf `pwd`/assets dist/trees/assets
|
wasm-bindgen --no-typescript --target web \
|
||||||
|
--out-dir ./dist/trees \
|
||||||
|
--out-name "trees" \
|
||||||
|
${CARGO_TARGET_DIR}/wasm32-unknown-unknown/release/trees.wasm
|
||||||
|
|
||||||
|
cp trees.html ./dist/trees/index.html
|
||||||
|
cp trees.css ./dist/trees/trees.css
|
||||||
|
|
||||||
|
rm -rf dist/trees/assets
|
||||||
|
|
||||||
|
rsync -av \
|
||||||
|
--include='*/' \
|
||||||
|
--include='*.png' \
|
||||||
|
--include='*.mono' \
|
||||||
|
--exclude='*' \
|
||||||
|
--delete \
|
||||||
|
assets/ \
|
||||||
|
dist/trees/assets
|
||||||
|
|
||||||
web/trees/serve: web/trees
|
web/trees/serve: web/trees
|
||||||
cd dist/trees && simple-http-server
|
cd dist/trees && simple-http-server
|
||||||
|
|
||||||
|
itch.io/trees:
|
||||||
|
butler push dist/trees popgame/trees:html5
|
||||||
|
|||||||
@ -1,10 +1,23 @@
|
|||||||
<html>
|
<html>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<link
|
<link rel="css" href="trees.css" />
|
||||||
data-trunk
|
|
||||||
rel="css"
|
|
||||||
href="trees.css"
|
|
||||||
/>
|
|
||||||
<link data-trunk rel="rust" data-bin="trees"/>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
<body style="margin: 0px;">
|
||||||
|
<script type="module">
|
||||||
|
import init from './trees.js'
|
||||||
|
|
||||||
|
init().catch((error) => {
|
||||||
|
if (!error.message.startsWith("Using exceptions for control flow, don't mind me. This isn't actually an error!")) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue