aboutsummaryrefslogtreecommitdiff
path: root/frontend/bin/dev-server
blob: 4819033fd126eac51b85c1d3dc7dea0138f3b90b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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