Skip to content
Type something to search...
Lumio Theme Documentation

Generated Config From TOML

One of the biggest beginner pain points in Lumio is that src/config/config.toml is not read directly everywhere.

Instead, Lumio converts it into a generated JSON file:

  • source: src/config/config.toml
  • generated output: .astro/config.generated.json

Why This Exists

A lot of Lumio code imports config like this:

import config from ".astro/config.generated.json";

This makes the config easy to consume from Astro components, utilities, and scripts without reparsing TOML everywhere.

How It Gets Generated

The build helper is:

  • scripts/toml-watcher.mjs

It:

  1. reads src/config/config.toml
  2. parses it with toml
  3. writes .astro/config.generated.json
  4. watches the TOML file in dev mode

Relevant script commands from package.json:

"dev": "npm run toml:watch -- --watch & astro dev",
"build": "npm run toml:watch && astro build && npm run remove-draft-from-sitemap",
"toml:watch": "node scripts/toml-watcher.mjs"

What This Means In Practice

In development

npm run dev starts Astro and the TOML watcher together, so changes to config.toml regenerate the JSON automatically.

In production build

npm run build regenerates the JSON first, then runs Astro build.

Common Confusion

If you edit config.toml but don’t see the expected change:

  1. make sure you started the project with npm run dev
  2. check that .astro/config.generated.json was regenerated
  3. restart dev if the watcher or editor replacement behavior got interrupted

Rule Of Thumb

  • Edit src/config/config.toml
  • Never manually edit .astro/config.generated.json

The generated JSON is an output artifact, not the source of truth.