Configuration Reference
Configuration
A configuration file is optional, but recommended.
Creating a dd.config.mjs
in the root of the project allows the different moving parts to read from the same (validated) source of truth.
Example
Directorydata/
- …
Directorysrc/
- …
- dd.config.mjs
- package.json
The following example configures the decision store with three data sources: the demo and sample data from @noodlestan/designer-decisions
and the local data/
directory.
import { defineConfig } from '@noodlestan/designer-functions';
import { DEMO_DATA, SAMPLE_DATA } from '@noodlestan/designer-decisions';
const LOCAL_DATA = './data';export default defineConfig({ store: { decisions: [SAMPLE_DATA, DEMO_DATA, LOCAL_DATA], },});
As explained in the Loading and Validating the minimum required configuration specifies only the list of data sources (DecisionSource) from which to load decision inputs (DecisionInput).
Both the minimal boilerplate and the Astro boilerplate, use a dd.config.mjs
in the root of the project.
Format
The configuration carries options for major pieces of the system:
options.store
: StoreOptions
The full configuration options are detailed in DesignerConfig.
Helpers
defineConfig()
Used in the dd.config.mjs
file.
Normalizes options for key entry points, such as the staticStoreBuilder().
loadConfig()
Used by some built-in modules, such as the Astro integration, and any place where access to the configuration is required.