Absolutely obscene build command for Render.com to build Go with Templ, Tailwind and HTMX.
export GOPATH=/opt/render/project/go && export PATH=$PATH:$GOPATH/bin && go install github.com/a-h/templ/cmd/templ@v0.2.408 && $GOPATH/bin/templ generate && npm install && npm run build_tailwind && go build -tags netgo -ldflags '-s -w' -o app
- Install Templ after some funky path stuff.
- Generate the Go files from the Templ templates
- Install node modules (needed for the Tailwind typography module)
- Run Tailwind to generate the CSS
- Build the Go app using Render's build command