feat: initialized tailwind

basic conig targetting templ
templ html page with import
Makefile job that generates for the run
This commit is contained in:
efim
2024-03-11 10:45:47 +00:00
parent de2fd2bdc0
commit 9c19bd7b6b
7 changed files with 49 additions and 11 deletions

View File

@@ -8,8 +8,16 @@ GENERATED_FILES := $(TEMPL_FILES:.templ=_templ.go)
$(GENERATED_FILES): $(TEMPL_FILES)
templ generate
# Run task depends on the generated files
run: $(GENERATED_FILES)
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'