From 2ff219a1cbbf6c058fc8d346293b9241db2f1588 Mon Sep 17 00:00:00 2001 From: ju6ge Date: Sun, 10 May 2026 14:39:16 +0200 Subject: [PATCH] build: add reusable build_website.sh script --- rust/build_website.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 rust/build_website.sh diff --git a/rust/build_website.sh b/rust/build_website.sh new file mode 100755 index 0000000..c198aef --- /dev/null +++ b/rust/build_website.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +WEBPACK_DIR="${SCRIPT_DIR}/src_webpack" +WEBSERVER_DIR="${SCRIPT_DIR}/src/webserver" + +rm -f "${WEBSERVER_DIR}/index.html.gz" +rm -f "${WEBSERVER_DIR}/bundle.js.gz" +rm -f "${WEBPACK_DIR}/index.html.gz" +rm -f "${WEBPACK_DIR}/bundle.js.gz" +rm -f "${WEBPACK_DIR}/index.html" +rm -f "${WEBPACK_DIR}/bundle.js" + +pushd "${WEBPACK_DIR}" +npm install +npx webpack build +cp index.html.gz "${WEBSERVER_DIR}/index.html.gz" +cp bundle.js.gz "${WEBSERVER_DIR}/bundle.js.gz" +popd