bext.config.toml
bext.config.toml sits at the root of a PRISM app and configures the server, build, and
rendering behavior. This page documents each section. For the route tree these settings
drive, see Routing & Rendering.
Minimal example
A minimal config: a PRISM app that watches its source for live reload and renders with ISR, revalidating every 10 minutes.
[server]
app_dir = "."
static_dir = "public"
[framework]
type = "prism"
[build]
watch_dirs = ["src/app", "src/components", "src/lib"]
live_reload = true
[rendering]
mode = "isr"
revalidate = 600
[server]
| Key | Example | Notes |
|---|---|---|
app_dir |
"." |
Root of the app. |
static_dir |
"public" |
Directory served as-is for static assets. |
[framework]
| Key | Value | Notes |
|---|---|---|
type |
"prism" |
Selects the PRISM framework. By default ("auto"), the framework is inferred from the project layout. |
[build]
| Key | Example | Notes |
|---|---|---|
watch_dirs |
["src", ...] |
Directories watched for live reload, relative to the site root. Empty by default. |
live_reload |
true |
Rebuilds and reloads the app shortly after a change under watch_dirs, also outside dev mode. false by default; no effect when watch_dirs is empty. |
debounce_ms |
200 |
How long, in milliseconds, successive changes are batched before the reload. Default: 200. |
public/islands/* is not watched. To force an island script to reload, add a ?v= query to
the <script src>. See Deploy a PRISM Site.
[build.css]
| Key | Value | Notes |
|---|---|---|
route_css |
true |
Generates the Tailwind rules for the classes found in the rendered HTML, on the fly, and inlines them in the page. false by default. |
route_css_complete |
true |
With route_css, generates rules from every class in the route's compiled code, not only the classes of the first render. Useful when a class only shows up after a client-side fragment swap. false by default. |
Both keys are read once per process: restart the site after changing them.
[rendering]
| Key | Example | Notes |
|---|---|---|
mode |
"isr" |
Turns on incremental static regeneration for every route of the site. Only "isr" has an effect; without it, there is no site-wide ISR cache. |
revalidate |
600 |
ISR revalidation window, in seconds. Default: 60 when mode = "isr". |
A route can set its own revalidation window with export const revalidate = <seconds>, and
opt out of the ISR cache with export const revalidate = false or
export const dynamic = "force-dynamic". See Routing & Rendering.
[compile]
| Key | Value | Notes |
|---|---|---|
on_demand |
true |
Compiles each page on its first request and caches it, with no pre-build. false by default, but a site declared with [framework] type = "prism" is always compiled on demand. |
[security.csp]
Per-site Content-Security-Policy overrides. Each key is a directive: its sources are added to
the default policy. Under [security.csp.replace], a directive replaces the default one
entirely. A directive missing from the default policy is added as given.
[security.csp]
script-src = ["https://cdn.example.com"]
style-src = ["https://fonts.googleapis.com"]
[security.csp.replace]
connect-src = ["'self'", "https://api.example.com"]
For a site the platform attaches to its domain automatically (see
Deploy a PRISM Site), [security.csp] is not applied: the platform's
global policy is used instead.
Related
- Routing & Rendering: the route tree and rendering modes
- CLI Reference: the commands that read this config
- Deploy a PRISM Site:
watch_dirs, live reload, and CSP