-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
46 lines (35 loc) · 923 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
45
46
SRC_FILES := $(shell find src -type f)
BIN := ./node_modules/.bin
.EXPORT_ALL_VARIABLES:
REV := $(shell git rev-parse --short HEAD)
BRANCH := $(shell git branch --show-current)
build: $(SRC_FILES) node_modules package.json svelte.config.js tsconfig.json yarn.lock
@echo "Starting build of $(BRANCH)-$(REV)"
@${BIN}/vite build || (rm -rf build && exit 1)
.PHONY: dev
dev: node_modules
@${BIN}/vite dev
.PHONY: preview
preview: build
@${BIN}/vite preview
.PHONY: check
check: node_modules
@${BIN}/svelte-check
@${BIN}/prettier -c src
.PHONY: format
format: node_modules
@${BIN}/prettier -w .
.PHONY: test
test: node_modules
@${BIN}/playwright test
.PHONY: test-ci
test-ci: node_modules
@${BIN}/playwright test --reporter github
node_modules:
yarn install --non-interactive --frozen-lockfile
.PHONY: clean
clean:
rm -rf build/ dist/ workers-site/
.PHONY: distclean
distclean: clean
rm -rf node_modules/