Baldur Bjarnason

... works as a web developer in Hveragerði, Iceland, and writes about the web, digital publishing, and web/product development

These are his notes

Here’s a minimal Makefile for transforming JS with esbuild

js_files := $(shell find src -name "*.js" -print)
js_targets := $(addprefix dist/, $(js_files))
.PHONY: js
js: $(js_targets)
dist/%.js: %.js
	@npx esbuild $? $(FLAGS) --outfile=$@ --format=esm --log-level=error