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);
Environment-specific files
Use one checked-in baseline and keep credentials outside the project. An explicit path can be supplied for local diagnostics without changing the shared configuration.
Configuration should make deployment differences visible without making ordinary defaults difficult to find.