> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# Function: loadConfig()

> **loadConfig**(`loadConfigOptions`: [`LoadConfigOptions`](/next/zh/api/packages/rspeedy/interfaces/LoadConfigOptions.md)): `Promise`\<[`LoadConfigResult`](/next/zh/api/packages/rspeedy/interfaces/LoadConfigResult.md)>

通过配置文件路径加载构建配置。

## Parameters

| Parameter           | Type                                                                                 | Description         |
| ------------------- | ------------------------------------------------------------------------------------ | ------------------- |
| `loadConfigOptions` | [`LoadConfigOptions`](/next/zh/api/packages/rspeedy/interfaces/LoadConfigOptions.md) | `loadConfig` 方法的选项。 |

## Returns

`Promise`\<[`LoadConfigResult`](/next/zh/api/packages/rspeedy/interfaces/LoadConfigResult.md)>

构建配置。

## Example

```ts
import { loadConfig } from '@lynx-js/rspeedy'

void async function () {
  const config = await loadConfig({ configPath: './lynx.config.js' })
  console.log(config);
}()
```
