aboutsummaryrefslogtreecommitdiff
path: root/frontend/bin
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/bin')
-rwxr-xr-xfrontend/bin/compile-sass3
-rwxr-xr-xfrontend/bin/compile-ts6
-rwxr-xr-xfrontend/bin/dev-server23
3 files changed, 32 insertions, 0 deletions
diff --git a/frontend/bin/compile-sass b/frontend/bin/compile-sass
new file mode 100755
index 0000000..79d5415
--- /dev/null
+++ b/frontend/bin/compile-sass
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+set -euo pipefail
+sass --no-error-css styles/main.sass ../backend/public/main.css
diff --git a/frontend/bin/compile-ts b/frontend/bin/compile-ts
new file mode 100755
index 0000000..0e1d62a
--- /dev/null
+++ b/frontend/bin/compile-ts
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+cd ts
+tsc --noEmit
+esbuild --bundle src/main.ts > ../../backend/public/main.js
diff --git a/frontend/bin/dev-server b/frontend/bin/dev-server
new file mode 100755
index 0000000..4819033
--- /dev/null
+++ b/frontend/bin/dev-server
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+# Killing watchexec ourselves, it may not be done otherwise.
+function finish {
+ if [ -n "${LIVE_SERVER_PID:-}" ]; then
+ kill "$LIVE_SERVER_PID" > /dev/null 2>&1
+ fi
+}
+
+trap finish EXIT
+
+watchexec \
+ --clear \
+ --watch ts \
+ --watch html \
+ --watch images \
+ --watch styles \
+ --debounce 100ms \
+ -- make &
+LIVE_SERVER_PID="$!"
+
+while true; do sleep 1; done