-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
36 lines (27 loc) · 835 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
KATEX= katex/katex.min.js katex/katex.min.css.js fonts
.PHONY: server all elm js site vscode http service-worker
all: js elm $(KATEX) service-worker
$(KATEX):
set -e
curl -L -O "https://github.com/KaTeX/KaTeX/releases/download/v0.16.11/katex.zip"
unzip katex.zip
mv katex katex-temp
mkdir katex
mv katex-temp/katex.min.js katex/
mv katex-temp/fonts fonts
{ echo "const katexStyles = \`"; cat katex-temp/katex.min.css; echo "\`;";} > katex/katex.min.css.js
rm katex.zip
rm -rf katex-temp
elm:
elm make src/Main.elm --output=js/elm.js
js:
npx esbuild --outfile=js/bundle.js ts/bundle.ts --bundle --global-name=Bundle --format=iife
# run http server
http:
npx esbuild --servedir=.
server: server.js
node server.js
server.js: ts/interface.d.ts ts/server.ts
npx tsc --outDir . $^
service-worker:
node swbuilder.js