Home > @momentum-design/builder > Builder > read

Builder.read() method

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Read the file located via the provided target and mount the data found within this Builder.

Signature:

read(target?: string | undefined): Promise<this>;

Parameters

ParameterTypeDescription
targetstring | undefined(Optional) Target path to attempt to read and mount to this Builder.

Returns:

Promise<this>

  • This Builder after executing this method.

Remarks

This method attempts to read files on the file system. Note that the target string will be ammended to the process execution path in order to locate the target configuration file. If the target, which aliases to the config.definitionPath is undefined, this method exits with the expectation that the configuration object is being mounted at the time this Builder is constructed.