-
Notifications
You must be signed in to change notification settings - Fork 57
/
Makefile
50 lines (39 loc) · 1.1 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
ESBUILD ?= node_modules/.bin/esbuild
TSC ?= node_modules/.bin/tsc
define ESBUILDCMD
$(ESBUILD) src/p5.image-map-creator.ts \
--outfile=dist/image-map-creator.bundle.js \
--bundle --sourcemap --target=es2016
endef
define ESBUILDNPMCMD
$(ESBUILD) src/p5.image-map-creator.ts \
--outdir=dist --bundle \
--external:downloadjs \
--external:quicksettings \
--external:undo-manager
endef
build: node_modules
$(ESBUILDCMD)
dist: node_modules
$(ESBUILDCMD) --minify
$(ESBUILDNPMCMD)
$(ESBUILDNPMCMD) --format=esm --out-extension:.js=.mjs
types: node_modules
$(TSC) --emitDeclarationOnly
watch: node_modules
$(ESBUILDCMD) --watch
node_modules: package.json package-lock.json
npm install
touch $@
.PHONY: release-patch release-minor release-major
release-patch release-minor release-major: release-%: dist types
npm version $* --tag-version-prefix=
git push
git push --tags
TAG=$$(git describe --tags --abbrev=0); gh release create $$TAG && gh release upload $$TAG dist/*.bundle.*
npm publish
check: node_modules
$(TSC) --noEmit
clean:
rm -rf dist node_modules
.PHONY: build dist types watch check clean