aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLia Lenckowski <lialenck@protonmail.com>2023-07-25 21:45:33 +0200
committerLia Lenckowski <lialenck@protonmail.com>2023-07-25 21:45:33 +0200
commite2badf5af99512c76466aa8782faa2079a6608ce (patch)
tree02c9f866b08b791e6d7531a7546de1a156849ccf
parentda4b5f623273bdb46d8e59f6d35fa7c236d50484 (diff)
downloadfastbangs-e2badf5af99512c76466aa8782faa2079a6608ce.tar
fastbangs-e2badf5af99512c76466aa8782faa2079a6608ce.tar.bz2
fastbangs-e2badf5af99512c76466aa8782faa2079a6608ce.tar.zst
proper builds, that make deployment somewhat easy
-rw-r--r--makefile30
1 files changed, 25 insertions, 5 deletions
diff --git a/makefile b/makefile
index b59e928..9ab4c64 100644
--- a/makefile
+++ b/makefile
@@ -1,8 +1,28 @@
-ESFLAGS = --target=esnext --sourcemap --format=esm
+ESFLAGS = --target=esnext --format=esm
+
+deploy-dir: deploy deploy/bundle.js deploy/index.html deploy/bangs-ddgless
+deploy.zip: deploy-dir
+ zip deploy.zip -r deploy
+
+deploy:
+ mkdir -p deploy
-all: frontend/bundle.js
watch:
- esbuild frontend/main.ts --bundle --outfile=frontend/bundle.js $(ESFLAGS) --watch
+ esbuild frontend/main.ts --bundle --outfile=deploy/bundle.js $(ESFLAGS) --watch
+
+deploy/bundle.js: $(shell find frontend -name '*.ts')
+ esbuild frontend/main.ts --bundle --outfile=deploy/bundle.js $(ESFLAGS)
+
+deploy/index.html: frontend/index.html
+ cp $< $@
+
+deploy/bangs-ddgless: $(shell find src -name '*.hs')
+ stack install --local-bin-path deploy
+
+clean:
+ stack clean --full
+ rm deploy/{bundle.js,index.html,bangs-ddgless}
+ rm deploy.zip
+ rmdir deploy # this may fail if the server was run, due to the bangs.json being generated
-frontend/bundle.js: $(shell find frontend -name '*.ts')
- esbuild frontend/main.ts --bundle --outfile=frontend/bundle.js $(ESFLAGS)
+.PHONY: watch clean