Prepare for netlify

This commit is contained in:
Cecile Tonglet 2020-09-21 14:09:31 +02:00
parent 1f6bada107
commit f62bc1e4c5
4 changed files with 16 additions and 8 deletions

2
.gitignore vendored
View file

@ -1,3 +1,3 @@
/target
/static
/public
/*.tgz

View file

@ -11,14 +11,19 @@ if ! [ -f core.tgz ]; then
fi
# cleanup
mkdir -p static
rm -fR static/.gitignore static/*
mkdir -p public
rm -fR public/.gitignore public/*
# copy index.html
cp static/index.html public/
# download blueprint css
bsdtar xOf core.tgz package/lib/css/blueprint.css > public/blueprint.css
# build
bsdtar xOf core.tgz package/lib/css/blueprint.css > static/blueprint.css
wasm-pack build --no-typescript --target web --out-name wasm --out-dir ./static "${options[@]}" "$@"
wasm-pack build --no-typescript --target web --out-name wasm --out-dir ./public "${options[@]}" "$@"
rc=$?
rm -fR static/{.gitignore,package.json}
rm -fR public/{.gitignore,package.json,README.md}
exit $rc

3
netlify.toml Normal file
View file

@ -0,0 +1,3 @@
[build]
publish = "public"
command = "./build.sh"

View file

@ -3,10 +3,10 @@
<head>
<meta charset="utf-8" />
<script type="module">
import init from "/static/wasm.js";
import init from "/wasm.js";
init();
</script>
<link rel="stylesheet" href="/static/blueprint.css">
<link rel="stylesheet" href="/blueprint.css">
<style>
body {
margin: 0;