ESFLAGS = --target=esnext --format=esm deploy-dir: deploy deploy/bundle.js deploy/style.css deploy/index.html deploy/fastbangs .PHONY: watch clean deploy-dir watch-script: esbuild frontend/main.ts --bundle --outfile=deploy/bundle.js $(ESFLAGS) --watch watch-style: while true; do inotifywait -e modify -e move frontend/style.sass; make deploy/style.css; done clean: stack clean --full rm -f deploy/{bundle.js,index.html,fastbangs} rm -f deploy.zip # This may fail if the server was run, due to bangs.json and banger.db. # This is intentional, as we don't want to delete some users' data rmdir deploy deploy.zip: deploy-dir zip deploy.zip -r deploy deploy: mkdir -p deploy deploy/index.html: frontend/index.html cp $< $@ deploy/fastbangs: $(shell find src -name '*.hs') stack install --local-bin-path deploy deploy/bundle.js: $(shell find frontend -name '*.ts') esbuild frontend/main.ts --bundle --outfile=deploy/bundle.js $(ESFLAGS) deploy/style.css: frontend/style.sass sassc $< $@