bext.dev
DocsConfiguration
Configuration3 min read
On this page

Build & Feature Flags

bext-server uses Cargo feature flags to keep the binary lean. Enable only what your deployment needs.

Available Features#

Feature What it enables When you need it
v8 V8 SSR engine (heap snapshots, TurboFan JIT) Default. The only supported render engine — required for SSR.
tls Auto-TLS (Let's Encrypt / ZeroSSL), SNI, OCSP Any production server serving HTTPS.
nginx-compat Drop-in nginx.conf parser, masquerade mode Replacing nginx. Required for --nginx-masquerade.
php PHP/FastCGI (embedded SAPI + FPM proxy) WordPress, Laravel, or any PHP site.
redis Redis pub/sub, sessions, distributed cache Horizontal scaling across multiple instances.
realtime SSE + WebSocket hub, topic pub/sub Real-time features (chat, notifications).
waf Web Application Firewall IP filtering, geo-blocking, SQLi/XSS detection.
plugins WASM + QuickJS + nsjail sandbox Running third-party plugins.
websocket-proxy Upstream WebSocket proxy passthrough Proxying WebSocket connections to backends.
otel OpenTelemetry tracing + metrics Observability pipelines (Jaeger, Grafana).
h3-quic HTTP/3 over QUIC Bleeding-edge HTTP/3 support.
ebpf eBPF-based monitoring Kernel-level observability.
react-compiler React Compiler Rust (auto-memoization) Experimental. Optimizes React bundles at build time.
turbopack In-process Turbopack bundler Experimental. Requires nightly Rust.
route-css Rust-native Tailwind CSS generation Per-route CSS, bext css command, live rebuild.
Tip

If you're unsure which features your binary includes, run bext-server version — it prints the full compiled feature list. This is the fastest way to confirm a feature was included without inspecting the build command.

Common Build Profiles#

Development (single app)#

bash
cargo build -p bext-server --release

Uses default features (v8 + route-css). Good for local development and simple deployments.

Production nginx replacement#

bash
cargo build -p bext-server --release \
  --features nginx-compat,tls,php

The minimum for replacing nginx on a server with PHP sites.

Production with V8#

bash
cargo build -p bext-server --release \
  --no-default-features \
  --features nginx-compat,tls,php,v8

V8 is the only SSR engine. --no-default-features drops feature baggage we don't need for this profile.

bash
cargo build -p bext-server --release \
  --no-default-features \
  --features nginx-compat,tls,redis,realtime,waf,v8,react-compiler,turbopack,php

Everything enabled. Requires nightly Rust for the turbopack feature:

bash
cargo +nightly-2026-04-02 build -p bext-server --release \
  --no-default-features \
  --features nginx-compat,tls,redis,realtime,waf,v8,react-compiler,turbopack,php,route-css

Bun Detection#

bext auto-detects the Bun binary for on-demand compilation. Detection order:

  1. BUN_PATH environment variable
  2. which bun (searches PATH)
  3. /usr/local/bin/bun, /usr/bin/bun
  4. $HOME/.bun/bin/bun

Override with: export BUN_PATH=/path/to/bun

Verifying Features#

Check which features are compiled into a binary:

bash
bext-server version

Output:

code
bext 0.1.2
build: release
features: v8, react-compiler, turbopack, tls, redis, realtime, waf, php, nginx-compat

Render Engine#

bext ships with V8 as the single SSR engine (via rusty_v8). Characteristics:

V8
Startup ~1ms per worker (heap snapshots)
JIT TurboFan
Thread model tokio-compatible (Send), in-process worker pool
Crash recovery ~1ms snapshot reload + per-route crash markers (see V8 Crash Isolation)
Config [render] workers = N — no engine selection needed

A second backend (WebKit/JavaScriptCore) historically existed; it was removed once V8's snapshot-based cold start made JSC redundant.

Release Profile#

The workspace Cargo.toml configures aggressive optimization:

toml
[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
strip = true

Build times are ~8-10 minutes with LTO on a typical server. Most of this is the final linking stage.

Edit this page ↗Need a hand? ↗
FIND YOUR NEXT STEP

Start with a topic, a command, or a question.