diff options
author | Lia Lenckowski <lialenck@protonmail.com> | 2023-07-25 21:45:33 +0200 |
---|---|---|
committer | Lia Lenckowski <lialenck@protonmail.com> | 2023-07-25 21:55:03 +0200 |
commit | c5b48eb41c8611a992f4624f9b49b95fb726ecbc (patch) | |
tree | 9301dd5bb184fe338711f0dc9a6addb41c4345af /makefile | |
parent | da4b5f623273bdb46d8e59f6d35fa7c236d50484 (diff) | |
download | fastbangs-c5b48eb41c8611a992f4624f9b49b95fb726ecbc.tar fastbangs-c5b48eb41c8611a992f4624f9b49b95fb726ecbc.tar.bz2 fastbangs-c5b48eb41c8611a992f4624f9b49b95fb726ecbc.tar.zst |
proper builds, that make deployment somewhat easy
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 30 |
1 files changed, 25 insertions, 5 deletions
@@ -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 |