bitque/jirs-client/scripts/prod.sh

35 lines
967 B
Bash
Raw Normal View History

#!/usr/bin/env bash
which rsass
if [[ "$status" != "0" ]]; then
cargo install rsass --features=commandline
fi
2021-01-07 09:13:13 +01:00
export PROJECT_ROOT=$(git rev-parse --show-toplevel)
export CLIENT_ROOT=${PROJECT_ROOT}/jirs-client
export HI_ROOT=${PROJECT_ROOT}/highlight/jirs-highlight
export MODE=force
export BUILD_TYPE=--release
. .env
2020-05-19 20:54:46 +02:00
rm -Rf build
mkdir build
2020-11-25 20:14:52 +01:00
cd $CLIENT_ROOT
wasm-pack build --mode normal --release --out-name jirs --out-dir $CLIENT_ROOT/build --target web
cd $HI_ROOT
wasm-pack build --mode normal --release --out-name hi --out-dir $CLIENT_ROOT/build --target web
cd $CLIENT_ROOT
rm -Rf ${CLIENT_ROOT}/build/styles.css
rsass -t Compressed ${PROJECT_ROOT}/jirs-client/js/styles.css > ${CLIENT_ROOT}/build/styles.css
2020-05-19 20:54:46 +02:00
cp -r ./static/* ./build
cat ./static/index.js |
sed -e "s/process.env.JIRS_SERVER_BIND/'$JIRS_SERVER_BIND'/g" |
sed -e "s/process.env.JIRS_SERVER_PORT/'$JIRS_SERVER_PORT'/g" &>./build/index.js
2020-05-19 20:54:46 +02:00
cp ./js/template.html ./build/index.html