-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
44 lines (39 loc) · 974 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
ESBUILD_TARGET_DIRECTORY ?= assets
CSS_ENTRYPOINTS := $(wildcard resources/ts/mdbook_*.ts)
CSS_SOURCES := $(wildcard resources/css/*.css)
TS_ENTRYPOINTS := $(wildcard resources/ts/global_*.ts)
TS_SOURCES := $(wildcard resources/ts/*.ts)
assets/global_mermaid.js: $(TS_SOURCES) .pnp.cjs
yarnpkg run esbuild \
--bundle \
--asset-names="./[name]" \
--entry-names="./[name]" \
--format=iife \
--loader:.jpg=file \
--loader:.otf=file \
--loader:.svg=file \
--loader:.ttf=file \
--loader:.webp=file \
--minify \
--outdir=$(ESBUILD_TARGET_DIRECTORY) \
--sourcemap \
--target=safari16 \
--tree-shaking=true \
--tsconfig=tsconfig.json \
$(TS_ENTRYPOINTS) \
;
.pnp.cjs: yarn.lock
yarnpkg install --immutable
touch .pnp.cjs
.PHONY: build
build: assets/global_mermaid.js
mdbook build
.PHONY: clean
clean:
rm -rf ./assets
.PHONY: serve
serve: assets/global_mermaid.js
mdbook serve \
--hostname 127.0.0.1 \
--port 3000 \
--watcher native