-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (29 loc) · 1.32 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
export PATH := ./node_modules/.bin:$(PATH)
ESFLAGS = --bundle --log-limit=0 --platform=browser --target=es2022 --minify-syntax --tsconfig=./tsconfig.json --jsx-factory=E --jsx-fragment=E.Fragment --format=esm
SOURCES = $(wildcard ./src/*.ts) $(wildcard ./src/observable/*.ts) Makefile
.PHONY: all docs types
files: src/types.ts dist/elt.js dist/elt.debug.js dist/elt.min.js dist/elt.debug.min.js dist/elt.cjs.js dist/elt.d.ts dist/elt.min.js.gz
all: files types
types:
tsc
watch:
tsc -w | wtsc make files
lint:
eslint src
src/types.ts: typegen/gen.js typegen/htmlref.yml
cd typegen && cat _types.ts > ../src/types.ts && node gen.js >> ../src/types.ts
dist/elt.js: $(SOURCES)
esbuild $(ESFLAGS) --define:DEBUG=false --sourcemap=inline --outfile=$@ src/index.ts
dist/elt.cjs.js: $(SOURCES)
esbuild $(ESFLAGS) --define:DEBUG=false --format=cjs --outfile=$@ src/index.ts
dist/elt.debug.js: $(SOURCES)
esbuild $(ESFLAGS) --define:DEBUG=true --sourcemap=inline --outfile=$@ src/index.ts
dist/elt.min.js: $(SOURCES)
esbuild $(ESFLAGS) --define:DEBUG=false --minify --outfile=$@ src/index.ts
dist/elt.min.js.gz: $(SOURCES) dist/elt.min.js
gzip -k9f dist/elt.min.js
wc -c dist/elt.min.js.gz
dist/elt.debug.min.js: $(SOURCES)
esbuild $(ESFLAGS) --define:DEBUG=true --minify --outfile=$@ src/index.ts
docs:
typedoc src/index.ts --watch