-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathMakefile
41 lines (31 loc) · 975 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
SOURCE_FILES:=$(shell find src/ -type f -name '*.ts')
EXAMPLE_FILES:=$(shell find examples/ -type f -name '*.js')
.PHONY:build
build: dist/build browser/oauth2-client.min.js browser/oauth2-client.min.js.gz
.PHONY:test
test:
npx tsx --test test/*.ts
.PHONY:lint
lint:
./node_modules/.bin/eslint --quiet 'src/**/*.ts' 'test/**/*.ts'
.PHONY:fix
fix:
./node_modules/.bin/eslint --quiet 'src/**/*.ts' 'test/**/*.ts' --fix
.PHONY:watch
watch:
./node_modules/.bin/tsc --watch
.PHONY:clean
clean:
rm -r browser/
rm -r dist/
dist/build: ${SOURCE_FILES}
./node_modules/.bin/tsc
touch dist/build
browser/oauth2-client.min.js: ${SOURCE_FILES} webpack.config.js
mkdir -p browser
./node_modules/.bin/webpack
browser/oauth2-client.min.js.gz: browser/oauth2-client.min.js
gzip --keep -f browser/oauth2-client.min.js
@# For some reason gzip makes the output file older than the input, so
@# just making sure it gets a good mtime.
touch browser/oauth2-client.min.js.gz