Meridian assembles configuration from a small number of predictable sources. Later sources replace only the values they define, allowing a deployment to override a shared project file without duplicating it.
Important
Environment variables are read when the process starts. Restart the process after changing them.
Source order
The following sources are applied from lowest to highest priority.
| Source | Scope | Purpose |
|---|---|---|
| Defaults | Package | Portable baseline |
meridian.json | Project | Shared settings |
| Environment | Host | Deployment values |
| Options | Process | Temporary overrides |
Loading values
The loader validates every resolved value before returning an immutable configuration object.
import { loadConfig } from "@meridian/config";
const config = await loadConfig({
file: "./meridian.json",
environment: process.env,
});
// Configuration is validated and frozen.
server.listen(config.http.port);
Missing values
Required properties produce a validation error when absent. Optional properties retain their documented defaults unless a higher-priority source supplies a value explicitly.