Add '18-expenses-chart/' from commit '78c9bd1d614c8bdd25a3e1d23bd0a39bb01e65f1'
git-subtree-dir: 18-expenses-chart git-subtree-mainline:e13fa186e1git-subtree-split:78c9bd1d61
This commit is contained in:
28
18-expenses-chart/Makefile
Normal file
28
18-expenses-chart/Makefile
Normal file
@@ -0,0 +1,28 @@
|
||||
# List of all .templ files
|
||||
TEMPL_FILES := $(shell find templates -type f -name '*.templ')
|
||||
|
||||
# Name of the generated file(s) from templ
|
||||
GENERATED_FILES := $(TEMPL_FILES:.templ=_templ.go)
|
||||
|
||||
# Generate Go files from .templ files only if they have changed
|
||||
$(GENERATED_FILES): $(TEMPL_FILES)
|
||||
templ generate
|
||||
|
||||
TAILWIND_CONFIG := tailwind.config.js
|
||||
INPUT_CSS := input.css
|
||||
OUTPUT_CSS := static/output.css
|
||||
|
||||
# generate tailwindcss output
|
||||
$(OUTPUT_CSS): $(TEMPL_FILES) $(TAILWIND_CONFIG) $(INPUT_CSS)
|
||||
tailwindcss -i $(INPUT_CSS) -o $(OUTPUT_CSS)
|
||||
|
||||
# Run the server, with dependencies on templ and tailwind generation
|
||||
run: $(GENERATED_FILES) $(OUTPUT_CSS)
|
||||
go run .
|
||||
|
||||
# this uses wgo to re-execute 'make run'
|
||||
# which will toggle templ generate, when needed
|
||||
# and then do `go run .` to rebuild all else
|
||||
.PHONY: run/live
|
||||
run/live:
|
||||
wgo -verbose -file=.go -file=.templ make run
|
||||
Reference in New Issue
Block a user