forked from yewprint/yewprint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·43 lines (31 loc) · 947 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
if [ ${#@} == 0 ]; then
options=(--release)
else
options=()
fi
if ! [ -f core.tgz ]; then
curl -o core.tgz https://registry.npmjs.org/@blueprintjs/core/-/core-3.30.0.tgz
fi
if ! [ -f docs-theme.tgz ]; then
curl -o docs-theme.tgz https://registry.npmjs.org/@blueprintjs/docs-theme/-/docs-theme-3.7.1.tgz
fi
# cleanup
mkdir -p public
rm -fR public/.gitignore public/*
# copy index.html
cp static/* public/
# copy favicon
cp yewprint-doc/src/logo.svg public/favicon.svg
# download blueprint css
tar xzOf core.tgz package/lib/css/blueprint.css > public/blueprint.css
# download blueprint doc css
tar xzOf docs-theme.tgz package/lib/css/docs-theme.css > public/docs-theme.css
# build
(cd yewprint-doc && \
wasm-pack build --no-typescript --target web --out-name wasm \
--out-dir ../public "${options[@]}" "$@")
rc=$?
rm -fR public/{.gitignore,package.json,README.md}
echo Wasm size: $(cat public/*.wasm | wc -c)
exit $rc