forked from trunk-rs/trunk
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Trunk.toml
99 lines (85 loc) · 3.46 KB
/
Trunk.toml
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
# An example Trunk.toml with all possible fields along with their defaults.
[build]
# The index HTML file to drive the bundling process.
target = "index.html"
# Build in release mode.
release = false
# The output dir for all final assets.
dist = "dist"
# The public URL from which assets are to be served.
public_url = "/"
[watch]
# Paths to watch. The `build.target`'s parent folder is watched by default.
watch = []
# Paths to ignore.
ignore = []
[serve]
# The address to serve on.
addr = "127.0.0.1"
# The port to serve on.
port = 8080
# Open a browser tab once the initial build is complete.
open = false
# Disable auto-reload of the web app.
no_autoreload = false
[clean]
# The output dir for all final assets.
dist = "dist"
# Optionally perform a cargo clean.
cargo = false
[tools]
# Default dart-sass version to download.
sass = "1.37.5"
# Default wasm-bindgen version to download.
wasm_bindgen = "0.2.74"
# Default wasm-opt version to download.
wasm_opt = "version_101"
## proxy
# Proxies are optional, and default to `None`.
# Proxies are only run as part of the `trunk serve` command.
[[proxy]]
# This WebSocket proxy example has a backend and ws field. This example will listen for
# WebSocket connections at `/api/ws` and proxy them to `ws://localhost:9000/api/ws`.
backend = "ws://localhost:9000/api/ws"
ws = true
[[proxy]]
# This proxy example has a backend and a rewrite field. Requests received on `rewrite` will be
# proxied to the backend after rewriting the `rewrite` prefix to the `backend`'s URI prefix.
# E.G., `/api/v1/resource/x/y/z` -> `/resource/x/y/z`
rewrite = "/api/v1/"
backend = "http://localhost:9000/"
[[proxy]]
# This proxy specifies only the backend, which is the only required field. In this example,
# request URIs are not modified when proxied.
backend = "http://localhost:9000/api/v2/"
[[proxy]]
# This proxy example has an insecure field. In this example,
# connections to https://localhost:9000/api/v3/ will not have certificate validation performed.
# This is useful for development with a server using self-signed certificates.
backend = "https://localhost:9000/api/v3/"
insecure = true
## hooks
# Hooks are optional, and default to `None`.
# Hooks are executed as part of Trunk's main build pipeline, no matter how it is run.
[[hooks]]
# This hook example shows all the current available fields. It will execute the equivalent of
# typing "echo Hello Trunk!" right at the start of the build process (even before the HTML file
# is read). By default, the command is spawned directly and no shell is used.
stage = "pre_build"
command = "echo"
command_arguments = ["Hello", "Trunk!"]
[[hooks]]
# This hook example shows running a command inside a shell. As a result, features such as variable
# interpolation are available. This shows the TRUNK_STAGING_DIR environment variable, one of a set
# of default variables that Trunk inserts into your hook's environment. Additionally, this hook
# uses the build stage, meaning it executes in parallel with all of the existing asset pipelines.
stage = "build"
command = "sh"
command_arguments = ["-c", "echo Staging directory: $TRUNK_STAGING_DIR"]
[[hooks]]
# This hook example shows how command_arguments defaults to an empty list when absent. It also uses
# the post_build stage, meaning it executes after the rest of the build is complete, just before
# the staging directory is copied over the dist directory. This means that it has access to all
# built assets, including the HTML file generated by trunk.
stage = "post_build"
command = "ls"