Skip to content

loadConfigDir

loadConfigDir<T>(options): Promise<ConfigDirArea<T>[]>

Defined in: cli/datapad/src/load-config-dir/load-config-dir.ts:16

Load the area files of a config directory: for each name in options.areas, the first of <cwd>/<dir>/<area>.{ts,js,mjs,cjs,json} that exists, loaded the way loadConfigFile loads a config. Areas with no file are left out, so a missing directory returns []. When one area has files in two formats, the extension priority picks one (.ts over .json). Throws ConfigFileError when a file exists but cannot be loaded. Holocron-agnostic: the directory and the area names are parameters, and what an area means is the caller’s.

Areas named in options.shared are also looked up in the repository root’s directory (see LoadConfigDirOptions.shared), so a config in a subdirectory can inherit what the repo declares once.

T = unknown

LoadConfigDirOptions

Promise<ConfigDirArea<T>[]>