Configuration
Every key of webfluent.app.json, its default, and what it changes.
A project's settings live in webfluent.app.json beside src/. Every key is optional except name, so the smallest config is:
json
{ "name": "my-site" }
A key the build does not know is reported with a warning — and the key it most likely meant, so "defaultLocale" says to write default_locale — rather than silently ignored (4.1).
The defaults
This is what a config with only a name means. i18n and offline are absent unless you add them.
json
{
"name": "my-site",
"version": "0.1.0",
"author": "",
"theme": {
"name": null,
"tokens": {},
"builtin": "full",
"dark": null
},
"build": {
"elements": [],
"output": "./build",
"minify": true,
"sourcemap": false,
"ssg": false,
"base_path": "",
"clean_urls": null,
"csp": false,
"split": true,
"compress": true,
"budget": {},
"runtime": "auto",
"media": {
"formats": ["webp"],
"widths": [480, 960, 1440, 1920],
"quality": 78,
"pipeline": true
},
"output_type": "spa",
"pdf": {
"page_size": "A4",
"margins": { "top": 72.0, "bottom": 72.0, "left": 72.0, "right": 72.0 },
"default_font": "Helvetica",
"default_font_size": 12.0,
"output_filename": null,
"fonts": [],
"system_fonts": true
},
"slides": {
"size": "16:9",
"width": null,
"height": null,
"default_font": "Helvetica",
"default_font_size": 24.0,
"margin": 60.0,
"show_slide_numbers": false,
"footer_text": null,
"background_color": null,
"chrome_color": null,
"output_filename": null,
"fonts": [],
"system_fonts": true
}
},
"dev": { "port": 3000, "hot_reload": true },
"meta": {
"integrity": {},
"title": "my-site",
"description": "",
"favicon": "",
"touch_icon": "",
"lang": "en",
"site_url": "",
"site_name": "",
"owner": "organization",
"same_as": [],
"job_title": "",
"image": "",
"image_alt": "",
"sitemap": true,
"fonts": [],
"preload": [],
"stylesheets": [],
"scripts": [],
"connect": [],
"img": []
},
"motion": { "duration": null, "easing": null },
"env": {},
"lints": {},
"public_env": []
}
wf init writes a shorter file and turns build.csp on.
The project
| Key | Default | Meaning |
|---|---|---|
|
|
— |
The only required key. The site's name, the PDF's file name when none is given, and |
|
|
|
Yours; nothing in the build reads them. |
build
| Key | Default | Meaning |
|---|---|---|
|
|
|
Where the build is written, relative to the project. |
|
|
|
|
|
|
|
Pre-render every page to its own HTML (chapter 26). |
|
|
|
The sub-path the site is served under, such as |
|
|
unset |
How a route's address avoids a redirect on a host that adds the slash: |
|
|
|
One script and stylesheet chunk per page, loaded when its route shows. |
|
|
|
Strip comments and whitespace from the scripts and stylesheets. |
|
|
|
Write a source map beside the bundle. |
|
|
|
Write a |
|
|
|
|
|
|
|
Emit a Content-Security-Policy and |
|
|
|
A gzipped size each named output should stay under: |
|
|
|
With |
|
|
below | The image pipeline. |
|
|
below | The paper outputs. |
build.media
| Key | Default | Meaning |
|---|---|---|
|
|
|
The formats every |
|
|
|
The widths written, where smaller than the original. |
|
|
|
The encoding quality, 1–100. |
|
|
|
|
build.pdf
| Key | Default | Meaning |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
The document's family when its sheets name none: a standard name ( |
|
|
|
In points; |
|
|
the project's name | The file written. |
|
|
|
Font files or directories beside the project's |
|
|
|
Whether this machine's fonts may stand in for a family or a character nothing in the project has; the build names each one used. |
build.slides
| Key | Default | Meaning |
|---|---|---|
|
|
|
|
|
|
|
Explicit points, overriding |
|
|
|
The space around each slide's content; what runs past it is clipped. |
|
|
|
The deck's text. |
|
|
|
|
|
|
|
Text in the bottom-left of every slide. |
|
|
|
A full-bleed colour for every slide. |
|
|
|
The colour of the numbers and footer; unset, it flips between dark and light on the slide's background. |
|
|
the project's name | The file written. |
|
|
|
As for |
dev
| Key | Default | Meaning |
|---|---|---|
|
|
|
The port |
|
|
|
Rebuild on a save, reload open tabs, and draw a failed build's error over the page. |
motion
| Key | Default | Meaning |
|---|---|---|
|
|
unset |
How long an animation runs when the element does not say: |
|
|
unset |
How it is paced: a CSS timing function, or a token such as |
meta
| Key | Default | Meaning |
|---|---|---|
|
|
the name, |
What a page falls back to when it declares none. |
|
|
|
The document's language. |
|
|
|
The absolute address. Without it, canonical links, the sitemap's URLs and absolute sharing URLs are left out rather than guessed. |
|
|
|
The name a link preview shows, and the site's owner in the structured data. |
|
|
|
Whether the owner is an |
|
|
|
The owner's profiles elsewhere, as its |
|
|
|
A person's |
|
|
|
More of the owner, as schema.org properties merged into its node as written: |
|
|
|
The sharing image for pages that set none; one in |
|
|
|
What that image shows: |
|
|
|
The icon a tab shows: a file in |
|
|
|
The icon a phone puts on its home screen: a 180×180 PNG in |
|
|
|
Write |
|
|
|
Web-font stylesheet URLs to link, each with a |
|
|
|
Files on this site to fetch with the page, ahead of the stylesheets: a font a project |
|
|
|
Extra stylesheets to link ahead of |
|
|
|
Libraries to load before the project's own scripts: a URL or a file in |
|
|
|
Origins a page may send requests to besides its own — an API elsewhere, an analytics endpoint — as the policy's |
|
|
|
Origins a page may load images from besides its own and |
|
|
|
Subresource-integrity hashes of external assets, by URL. |
theme
| Key | Default | Meaning |
|---|---|---|
|
|
unset |
Which |
|
|
unset |
The theme that stands in for dark mode (chapter 15). |
|
|
|
|
|
|
|
Token values on top of the theme, for a pipeline to supply. |
i18n
json
{ "i18n": { "default_locale": "en", "locales": ["en", "ar"], "dir": "src/translations" } }
| Key | Default | Meaning |
|---|---|---|
|
|
|
The locale a page opens in. |
|
|
|
Every locale; one JSON file each. |
|
|
|
Where the files are. |
env and publicenv
| Key | Default | Meaning |
|---|---|---|
|
|
|
Values read as |
|
|
|
Names a page may read beyond those beginning |
offline
4.1. Absent, no service worker is written.
json
{ "offline": { "precache": ["/", "/docs/*"], "fallback": "/offline", "cache": { "/api/*": "network-first" }, "sync": true } }
| Key | Default | Meaning |
|---|---|---|
|
|
|
The routes a first visit stores, as globs; |
|
|
|
A page's path, shown for a route that was not stored. |
|
|
|
How paths the build did not write are fetched: |
|
|
|
Keep writes made offline and send them later. |
lints
What a finding counts as, by its code or its family — "off", "warn" or "error", the code first, then the family:
json
{ "lints": { "A11": "off", "U": "error", "R01": "warn" } }
A warning may be turned off or made an error. An error may be lowered only when it cannot ship a broken page — R01 (a link to a route that is missing), C02 (a prop nothing reads), S04 (two pages on one route) and I01, I02, I04 (a message that shows its key or a placeholder); asking to lower any other is itself refused, and so is a key that is no code or family. Every code is in Diagnostics. One finding on one line is allowed with a // wf-allow(CODE) comment instead, under the same rule.
On this page
The defaults The project build dev motion meta theme i18n env and publicenv offline lintsChecked by the test suite
Every code block in the guide is parsed, checked and type-checked on each release.