feat: add build tag to skip Brotli support (#1070)

* feat: add build tag to skip Brotli support

* update docs
This commit is contained in:
Kévin Dunglas
2024-10-08 18:57:34 +02:00
committed by GitHub
parent 56d2f99548
commit 95c381ec78
8 changed files with 56 additions and 11 deletions

View File

@@ -81,7 +81,6 @@ XCADDY_GO_BUILD_FLAGS="-ldflags '-w -s'" \
xcaddy build \
--output frankenphp \
--with github.com/dunglas/frankenphp/caddy \
--with github.com/dunglas/caddy-cbrotli \
--with github.com/dunglas/mercure/caddy \
--with github.com/dunglas/vulcain/caddy
# Add extra Caddy modules here
@@ -96,3 +95,24 @@ xcaddy build \
> To do so, change the `XCADDY_GO_BUILD_FLAGS` environment variable to something like
> `XCADDY_GO_BUILD_FLAGS=$'-ldflags "-w -s -extldflags \'-Wl,-z,stack-size=0x80000\'"'`
> (change the value of the stack size according to your app needs).
## Build Tags
Additional features can be enabled if the required C libraries are installed by
passing additional build tags to the Go compiler:
| Tag | Dependencies | Description |
|--------|--------------------------------------------|--------------------------------------------------|
| brotli | [Brotli](https://github.com/google/brotli) | Add a Caddy module supporting Brotli compression |
When using `go build` directly, pass the additional `-tags` option followed by the comma-separated list of tags:
```console
go build -tags brotli
```
When using `xcaddy`, set the `-tags` option in the `XCADDY_GO_BUILD_FLAGS` environment variable:
```console
XCADDY_GO_BUILD_FLAGS="-tags brotli"
```