defineConfig()
Defines a configuration object that can be used across different parts of the same system.
type defineConfig = ( config: DeepPartial<DesignerConfig>,) => Promise<ResolvedConfig<DesignerConfig>>;
Return value
Promise<ResolvedConfig<DesignerConfig>>
If you need to implement loadConfig()
for a specific use case not covered by the built-in configuration loader, you can use the return value of defineConfig()
(the default export of dd.config.mjs
) to inspect errors and provide feedback to the user.
Note: The default export of dd.config.mjs
is the the return value of defineConfig()
which is a promise. The value needs to be awaited on before it can be used.
The ResolvedConfig
type contains both the validation errors and the DesignerConfig object with defaults applied.
import resolved from 'dd.config.mjs';const resolved = await resolved;console.info(resolved.config);console.error(resolved.errors);
Params
༶ config
: DesignerConfig
Usage
Refer to the examples in API / configuration.