Skip to content

Commit 0a33747

Browse files
committed
better bundling
1 parent 882ab70 commit 0a33747

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

bin/bundle

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
#! /bin/sh
22

3+
rm -rf lib
4+
35
if [ "$1" = "dev" ]; then
46
OPTS="--sourcemap --watch"
7+
TSC_OPTS="--watch"
8+
elif [ "$1" = "test" ]; then
9+
OPTS="--sourcemap"
510
else
611
OPTS="--minify"
7-
(cd lib && rm *.js.map) >> /dev/null 2>&1
812
fi
9-
npx esbuild src/vanilla.ts src/over-the-top.ts --bundle $OPTS --target=ESnext --outdir=lib
1013

11-
tsc
14+
if echo "$TSC_OPTS" | grep -q -- "--watch"; then
15+
tsc $TSC_OPTS &
16+
else
17+
tsc $TSC_OPTS
18+
rm -rf lib/bundled
19+
npx esbuild src/vanilla.ts src/over-the-top.ts --bundle $OPTS --target=ESnext --outdir=lib
20+
cp lib/*.js lib/*.map tests >/dev/null 2>&1
21+
fi
22+
23+
rm -f lib/over-the-top.d.ts
24+
rm -f lib/vanilla.d.ts

bin/test

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)