property ConfigPluginOptions.instance
Since 0.2.0

An already-loaded configuration snapshot to use verbatim.

Present → nothing is read from the environment or from disk, the three options above are ignored, and this exact object becomes the application's CAPABILITIES.CONFIG service. Absent → configuration is loaded normally.

This exists so configuration can be resolved BEFORE plugins are constructed — deciding which plugins to register from a value in the environment — without the application then loading a second snapshot. Two snapshots read at different moments can disagree, and the one the composer branched on would not be the one handlers read.

Examples

Composing from configuration, then reusing the same snapshot

import { createRuntimeServices } from '@setu-ts/runtime';
import { ConfigPlugin, loadConfig } from '@setu-ts/config-plugin';

const config = await loadConfig(createRuntimeServices());
const plugins = [ConfigPlugin({ instance: config })];

Type

IConfig

Usage

import { type ConfigPluginOptions } from "config-plugin/src/index.ts";