-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
50 lines (40 loc) · 1.36 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
47
48
49
50
SHELL := /bin/bash
DIST ?= dist
.PHONY: prepare
prepare:
npx husky install
cp node_modules/github-markdown-css/github-markdown-*.css src/assets
cp node_modules/highlight.js/styles/github-dark.css src/assets/highlightjs-github-dark.css
cp node_modules/highlight.js/styles/github.css src/assets/highlightjs-github-light.css
cp node_modules/katex/dist/contrib/copy-tex.min.js src/assets/katex-copy-tex.min.js
if [[ -e src/assets/fonts ]]; then rm -rf src/assets/fonts; fi
mkdir src/assets/fonts
cp node_modules/katex/dist/fonts/* src/assets/fonts # not use -r or -R on mac
cp node_modules/katex/dist/katex.min.css src/assets
.PHONY: lint
lint:
npx eslint --fix .
npx stylelint "src/**/*.{css,scss}" --fix
# npx tsc -p . -noEmit
@echo -e '\033[1;32mNo lint errors found.'
.PHONY: clean
clean:
-rm -r ${DIST}
.PHONY: dev
dev: clean
npx vite --mode development --config config/vite.dev.mts
.PHONY: build\:client
build\:client:
npx vite build --mode production --config config/vite.prod.mts
.PHONY: build\:server
build\:server:
npx vite build --mode production --config config/vite.server.mts
npx vite build --mode production --config config/vite.serverEntry.mts
.PHONY: build
build: clean build\:server build\:client
.PHONY: start
start: build
node cli.js -o -r ../docs
.PHONY: test
test:
NODE_ENV=test npx jest --coverage --silent --runInBand --detectOpenHandles