-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
53 lines (46 loc) · 1.24 KB
/
Taskfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
version: 3
tasks:
setup:
desc: Installs the tools needed to run the application
cmds:
- go install github.com/a-h/templ/cmd/[email protected]
generate:templ:
desc: Generate code
sources:
- ./**/*.templ
generates:
- ./**/*_templ.go
cmds:
- templ generate
generate:css:
aliases: [css]
vars:
OUTPUT_FILE: assets/public/main.dist.css
sources:
- "**/*.css"
- exclude: "{{.OUTPUT_FILE}}"
generates:
- assets/public/main.dist.css
cmds:
- npx [email protected] --minify --bundle --targets '>= 0.25%' ./assets/main.css -o {{.OUTPUT_FILE}}
- templ generate --notify-proxy > /dev/null 2>&1 || true
generate:
aliases: [gen]
deps: [generate:templ, generate:css]
dev:
desc: Run the application for development
cmds:
- templ generate --watch --proxy="http://localhost:8080" --open-browser=false --cmd="task run --watch --interval=100ms" -v
run:
desc: Run the application. Use `task dev` to run with live reload.
deps: [build, generate:css]
cmds:
- ./bin/server
build:
desc: Build the application
sources:
- '**/*.go'
generates:
- ./bin/server
cmds:
- go build -o ./bin/server main.go