XpmBuildConfigurations.get() method
Retrieves a build configuration by name, creating it if required.
Signature
get(buildConfigurationName: string): XpmBuildConfiguration;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
buildConfigurationName |
string |
The build configuration name to retrieve. |
Returns
The build configuration instance.
Exceptions
XpmInputError If a configuration with the specified name does not exist.
Remarks
This method implements lazy evaluation to avoid unnecessary operations. Build configurations are instantiated on demand but remain uninitialised until actually used.
Retrieval process:
- Check if the configuration already exists in the internal map.
- If found and already instantiated, return the existing instance.
- If the configuration name is unknown (not in JSON name mapping), throw
XpmInputError. - For known but not yet instantiated configurations:
- Resolve the original JSON configuration name (handles both regular and template-generated configurations).
- Retrieve the JSON configuration definition.
- Create a new
XpmBuildConfigurationinstance. - Store the instance in the map for future access.
- Return the configuration instance (still uninitialised).
The two-step lazy evaluation process:
- During collection initialisation (
XpmBuildConfigurations.initialise()), only the matrix of options is evaluated for each template, expanding configuration names without processing their content. - Later, when a configuration is accessed via this method and subsequently initialised (
XpmBuildConfiguration.initialise()), the template is fully evaluated and Liquid substitutions are performed on all properties.
This approach ensures that only build configurations that are actually used incur the cost of template evaluation and variable substitution.
Generated via tsdoc2docusaurus 1.3.0-pre by API Extractor/Documenter 7.55.2.