#! /bin/sh rm -rf lib if [ "$1" = "dev" ]; then OPTS="--sourcemap --watch" TSC_OPTS="--watch" elif [ "$1" = "test" ]; then OPTS="--sourcemap" else OPTS="--minify" fi if echo "$TSC_OPTS" | grep -q -- "--watch"; then npx tsc $TSC_OPTS & else npx tsc $TSC_OPTS rm -rf lib/bundled npx esbuild src/vanilla.ts src/over-the-top.ts --bundle $OPTS --target=ESnext --outdir=lib # cp lib/*.js lib/*.map tests/public >/dev/null 2>&1 fi rm -f lib/over-the-top.d.ts rm -f lib/vanilla.d.ts