bin/serve.sh (view raw)
1#!/usr/bin/env bash
2
3vite="$1"
4if [ -z "$vite" ]; then
5 vite="vite"
6fi
7
8echo "using vite command: $vite"
9
10kill_vite() {
11 trap SIGINT
12 echo "cleaning up..."
13 pkill vite
14 exit
15}
16trap "kill_vite" INT
17
18"$vite" serve &
19find pages/ static/ templates/ | entr "$vite" build
20
21trap SIGINT