/ Trunk.toml
Trunk.toml
  1  # [[file:CONTRIBUTING.org::*\[\[https:/github.com/trunk-rs/trunk\]\[Trunk\]\]][[[https://github.com/trunk-rs/trunk][Trunk]]:1]]
  2  trunk-version  = "*" # semver version requirement of trunk for this project
  3  
  4  # [[hooks]]
  5  # stage = "post_build"
  6  # command = "sh"
  7  # command_arguments = [
  8  #   "-c",
  9  #   "cp ./dist/index.html ./assets/static/ && cp ./dist/*.js ./assets/static/ && cp ./dist/*.wasm ./assets/static/"
 10  # ]
 11  
 12  [build]
 13  public_url     = "/"       # The public URL from which assets are to be served.
 14  inject_scripts = true
 15  release        = true
 16  # cargo_profile = ""       # Use a custom cargo profile. Overrides the default chosen by cargo. Ignored if the 'index.html' has one configured.
 17  filehash       = false
 18  offline        = false     # Run without network access
 19  frozen         = false     # Require Cargo.lock and cache are up to date
 20  locked         = false     # Require Cargo.lock is up to date
 21  create_nonce   = false     # Allow injecting a nonce attribute
 22  no_sri         = false     # Allow disabling sub-resource integrity (SRI)
 23  dist           = "dist"
 24  minify         = "always"  # one of: never, on_release, always
 25  target         = "index.html"
 26  # cargo_profile = "release-trunk" # An optional cargo profile to use
 27  
 28  [clean]
 29  cargo          = false     # Optionally perform a cargo clean.
 30  
 31  [watch]
 32  watch          = []        # Paths to watch. The `build.target`'s parent folder is watched by default.
 33  ignore         = []        # Paths to ignore.
 34  
 35  [serve]
 36  port           = 8080
 37  ws_protocol    = "ws"      # Protocol used for autoreload WebSockets connection.
 38  open           = false     # Open a browser tab once the initial build is complete.
 39  no_spa         = false     # Whether to disable fallback to index.html for missing files.
 40  no_autoreload  = false     # Disable auto-reload of the web app.
 41  addresses      = [ "127.0.0.1" ]
 42  no_error_reporting = false     # Disable error reporting
 43  disable_address_lookup = false # Disable the reverse DNS lookup during startup
 44  # aliases        = ["http://localhost.mywebsite.com"] # Aliases to serve, typically found in an /etc/hosts file.
 45  # headers        = { "test-header" = "header value", "test-header2" = "header value 2" } # Additional headers set for responses.
 46  # headers        = { "X-Foo" = "bar" } # Additional headers to send. NOTE: header names must be valid HTTP headers.
 47  # The certificate/private key pair to use for TLS, which is enabled if both are set.
 48  # tls_key_path   = "self_signed_certs/key.pem"
 49  # tls_cert_path  = "self_signed_certs/cert.pem"
 50  
 51  # [tools]
 52  # sass           = "1.69.5" # Default dart-sass version to download.
 53  # wasm_bindgen   = "0.2.89" # Default wasm-bindgen version to download.
 54  # wasm_opt       = "version_123" # Default wasm-opt version to download.
 55  # tailwindcss    = "3.3.5" # Default tailwindcss-cli version to download.
 56  
 57  ## proxy
 58  # Proxies are optional, and default to `None`.
 59  # Proxies are only run as part of the `trunk serve` command.
 60  
 61  # [[proxy]]
 62  # # This WebSocket proxy example has a backend and ws field. This example will listen for
 63  # # WebSocket connections at `/api/ws` and proxy them to `ws://localhost:9000/api/ws`.
 64  # ws             = true
 65  # backend        = "ws://localhost:9000/api/ws"
 66  
 67  # [[proxy]]
 68  # # This proxy example has a backend and a rewrite field. Requests received on `rewrite` will be
 69  # # proxied to the backend after rewriting the `rewrite` prefix to the `backend`'s URI prefix.
 70  # # E.G., `/api/v1/resource/x/y/z` -> `/resource/x/y/z`
 71  # rewrite = "/api/v1/"
 72  # backend = "http://localhost:9000/"
 73  
 74  # [[proxy]]
 75  # # This proxy specifies only the backend, which is the only required field. In this example,
 76  # # request URIs are not modified when proxied.
 77  # backend = "http://localhost:9000/api/v2/"
 78  
 79  # [[proxy]]
 80  # # This proxy example has an insecure field. In this example,
 81  # # connections to https://localhost:9000/api/v3/ will not have certificate validation performed.
 82  # # This is useful for development with a server using self-signed certificates.
 83  # insecure = true
 84  # backend = "https://localhost:9000/api/v3/"
 85  
 86  # [[proxy]]
 87  # # This proxy example has the no_system_proxy field. In this example,
 88  # # connections to https://172.16.0.1:9000/api/v3/ will bypass the system proxy.
 89  # # This may be useful in cases where a local system has a proxy configured which cannot be reconfigured, but the
 90  # # proxy target (of trunk serve) is not know/accessible by the system's proxy.
 91  # backend = "https://172.16.0.1:9000/api/v3/"
 92  # no_system_proxy = true
 93  
 94  ## hooks
 95  # Hooks are optional, and default to `None`.
 96  # Hooks are executed as part of Trunk's main build pipeline, no matter how it is run.
 97  
 98  # [[hooks]]
 99  # # This hook example shows all the current available fields. It will execute the equivalent of
100  # # typing "echo Hello Trunk!" right at the start of the build process (even before the HTML file
101  # # is read). By default, the command is spawned directly and no shell is used.
102  # stage = "pre_build"
103  # command = "echo"
104  # command_arguments = ["Hello", "Trunk!"]
105  
106  # [[hooks]]
107  # # This hook example shows running a command inside a shell. As a result, features such as variable
108  # # interpolation are available. This shows the TRUNK_STAGING_DIR environment variable, one of a set
109  # # of default variables that Trunk inserts into your hook's environment. Additionally, this hook
110  # # uses the build stage, meaning it executes in parallel with all of the existing asset pipelines.
111  # stage = "build"
112  # command = "sh"
113  # command_arguments = ["-c", "echo Staging directory: $TRUNK_STAGING_DIR"]
114  
115  # [hooks.windows]
116  # # This shows how to create OS-specific overrides for hooks.
117  # # This will override the hook directly above it.
118  # # For overrides, only the `command` and `command_arguments` keys must be specified.
119  # # Valid values are `windows`, `macos`, and `linux`.
120  # command = "cmd"
121  # command_arguments = ["/c", "echo Staging directory: %TRUNK_STAGING_DIR%"]
122  
123  # [[hooks]]
124  # # This hook example shows how command_arguments defaults to an empty list when absent. It also uses
125  # # the post_build stage, meaning it executes after the rest of the build is complete, just before
126  # # the staging directory is copied over the dist directory. This means that it has access to all
127  # # built assets, including the HTML file generated by trunk.
128  # stage = "post_build"
129  # command = "ls"
130  # [[https://github.com/trunk-rs/trunk][Trunk]]:1 ends here