-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
30 lines (25 loc) · 1.04 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
ESBUILD_PATH ?= node_modules/.bin/esbuild
.PHONY: all clean
all: docs/leaflet-and-co.css docs/leaflet-and-co.js docs/images
clean:
rm -f docs/leaflet-and-co.{css,js}
rm -rf docs/images
docs/leaflet-and-co.css: node_modules/leaflet/dist/leaflet.css \
node_modules/leaflet.markercluster/dist/MarkerCluster.css \
node_modules/leaflet.markercluster/dist/MarkerCluster.Default.css \
node_modules/leaflet-search/dist/leaflet-search.min.css \
node_modules/leaflet-search/dist/leaflet-search.mobile.min.css
for f in $^; do (cat $$f; echo); done \
| $(ESBUILD_PATH) --loader=css --minify \
| cat <(cat leaflet-prefix.txt) - \
> $@
docs/leaflet-and-co.js: node_modules/leaflet/dist/leaflet.js \
node_modules/leaflet.markercluster/dist/leaflet.markercluster.js \
node_modules/leaflet-search/dist/leaflet-search.src.js
for f in $^; do (cat $$f; echo); done \
| $(ESBUILD_PATH) --minify \
| cat <(cat leaflet-prefix.txt) - \
> $@
docs/images: $(wildcard node_modules/leaflet/dist/images/* node_modules/leaflet-search/images/*)
mkdir $@
cp -r $^ $@