-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
executable file
·45 lines (30 loc) · 1013 Bytes
/
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
.PHONY: all test clean update testclean distclean
files = index.js
sources = $(addprefix lib/, $(files))
#run: all
# @ echo $(sources)
all: dist/reurl.min.js
test: test/run/urltestdata.json
@ echo ""
@ node test/run.js
@ echo ""
clean: testclean distclean
## ES Module Bundle
dist/reurl.min.js: dist/ package.json $(sources)
@ echo "Making a minified ES module bundle"
@ esbuild --bundle --format=esm --minify lib/index.js > dist/reurl.min.js
dist/:
@ mkdir dist/
distclean:
@ echo "Removing dist/ directory"
@ test -d dist/ && rm -r dist/ || exit 0
## Tests
test-update: testclean test/run/urltestdata.json
test/run/:
@ mkdir test/run/
test/run/urltestdata.json: test/run/
@ echo "\nGet latest web platform URL tests"
@ echo "==================================\n"
@ curl https://raw.githubusercontent.com/web-platform-tests/wpt/master/url/resources/urltestdata.json > test/run/urltestdata.json
testclean:
@ test -d test/run/ && echo "Removing test/run/" && rm -r test/run/ || exit 0