-
Notifications
You must be signed in to change notification settings - Fork 3
/
example-config.yml
129 lines (101 loc) · 4.71 KB
/
example-config.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# proxy-timeout defines how long to wait for the
# application server process to start when receiving
# connection refused errors while proxying.
proxy-timeout: 10s
# lint enables golangci-lint when true.
lint: true
# templier-host defines what host address to run Templiér on.
templier-host: "your-application:11000"
log:
# level allows you to chose from different log levels:
# "" (empty): same as erronly.
# erronly: error logs only.
# verbose: verbose logging of relevant events and timings.
# debug: verbose debug logging.
level: erronly
# clear-on allows you to specify when, if at all, the console logs should be cleared:
# "" (empty): disables console log clearing.
# "restart": clears console logs only on app server restart.
# "file-change": clears console logs on every file change.
clear-on:
# print-js-debug-logs enables Templiér debug logs in the browser.
print-js-debug-logs: true
debounce:
# debounce.templ defines how long to wait for more _templ.txt file changes
# after the first one occured before triggering all browser tabs to reload.
templ: 50ms
# debounce.go defines how long to wait for more non-templ file changes
# after the first one occured before triggering server rebuild and restart.
go: 50ms
# tls can be set to null to serve HTTP instead of HTTPS.
tls:
# tls.cert defines the TLS certificate file path.
cert: ./your-application.crt.pem
# tls.keys defines the TLS private key file path.
key: ./your-application.key.pem
app:
# app.dir-src-root defines the path to the Go module source root directory.
dir-src-root: ./
# app.exclude defines glob filter expressions relative to app.dir-src-root
# to match files exluded from watching.
exclude:
- .* # all hidden files and directories
- "*~" # all temporary files with a tilde (fixes jetbrains IDEs save)
# app.dir-cmd defines the path to the main package directory
# within the app source directory.
dir-cmd: ./cmd/server/
# app.dir-work defines the path to the workspace directory
# to run the application server executable in.
dir-work: ./
# app.host defines the host address the application server is running on.
host: https://your-application:12000
# app.go-flags defines additional Go compiler CLI arguments to provide when
# compiling the application server executable.
go-flags:
# app.flags defines the CLI arguments as a string provided
# to the application server executable.
flags: -host your-application:12000
# custom-watchers defines custom file change watchers executing arbitrary commands
# on certain file changes that isn't covered by a standard Templiér setup.
custom-watchers:
- name: "Bundle JS"
# cmd specifies the command to run when a JavaScript or JSX file is changed.
# This is optional and can be left empty since sometimes all you want to do is
# rebuild, or restart or simply reload the browser tabs.
cmd: npm run build
# include defines that this watcher will watch all JavaScript and JSX files.
include: ["*.js", "*.jsx"]
exclude: # exclude is optional.
# fail-on-error specifies that in case cmd returns error code 1 the output
# of the execution should be displayed in the browser, just like
# for example if the Go compiler fails to compile.
fail-on-error: true
# debounce specifies how long to wait for more file changes
# after the first one occured before executing cmd.
# Default debounce duration is applied if left empty.
debounce:
# requires specifies that browser tabs need to be reloaded when a .js or .jsx file
# changed and cmd was successfuly executed, but the server doesn't need to be
# rebuilt or restarted.
# This option accepts the following values:
# - "" (or empty field) = no action, execute cmd and don't do anything else.
# - "reload" = reload all browser tabs.
# - "restart" = restart the server but don't rebuild it.
# - "rebuild" = re-lint, rebuild and restart the server.
requires: reload
- name: "Restart on config change"
# cmd specifies that no special command needs to be executed since this watcher
# just triggers a server restart.
cmd:
# include specifies what kind of configuration files need to be watched.
include: ["*.yaml", "*.yml", "*.toml"]
# exclude specifies what kind of configuration files, that would otherwise
# match `include` to explicitly exclude.
exclude: ["ignore-this.yaml"]
# fail-on-error doesn't need to be specified when cmd is empty. Default is false.
fail-on-error:
# debounce specifies default debounce duration.
debounce:
# requires specifies that when a config file changes the server needs
# to be restarted, but doesn't need to be rebuilt.
requires: restart