refactor: add esbuild and modulerize css into seperate files

This commit is contained in:
rramiachraf
2024-03-06 17:32:10 +01:00
parent edc2b04198
commit c8747c0182
13 changed files with 548 additions and 463 deletions

View File

@ -1,8 +1,12 @@
VERSION=`git rev-parse --short HEAD`
gentempl:
@command -v templ &> /dev/null || go install github.com/a-h/templ/cmd/templ@latest
build:gentempl
templ generate && go build -ldflags="-X 'github.com/rramiachraf/dumb/data.Version=$(VERSION)' -s -w"
command -v templ &> /dev/null || go install github.com/a-h/templ/cmd/templ@latest
esbuild:
[ ! -f ./esbuild ] && curl -fsSL https://esbuild.github.io/dl/latest | sh
build:gentempl esbuild
templ generate
cat ./style/*.css | ./esbuild --loader=css --minify > ./static/style.css
go build -ldflags="-X 'github.com/rramiachraf/dumb/data.Version=$(VERSION)' -s -w"
fmt:
templ fmt .