[**Documentation**](../../../../../README)

***

[Documentation](../../../../../README) / [@zerotal/core](../../../README) / [macros/config.macro](../README) / loadConfigsSync

# Function: loadConfigsSync()

> **loadConfigsSync**(`configDir`): `Record`\<`string`, `Record`\<`string`, `unknown`\>\>

Defined in: [macros/config.macro.ts:38](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/macros/config.macro.ts#L38)

Bun macro — scan a config directory and return all configs as a static object.

⚠️  USE ONLY WITH `bun build --compile`.
This macro is evaluated at bundle time and is primarily intended for baking
config values into a self-contained binary. Do NOT use it in zt.ts for
development or test workflows — it fails on Windows when the argument
contains a runtime expression like `${process.cwd()}`.

For development (and for all apps not compiled to a binary), import configs
directly instead:

```ts
// zt.ts — preferred approach (works everywhere)
import appConfig      from './config/app.ts';
import databaseConfig from './config/database.ts';
app.useConfig({ app: appConfig, database: databaseConfig, ... });
```

For compiled binaries only:

```ts
import { loadConfigsSync } from '@zerotal/core/macros/config' with { type: 'macro' };
const configs = loadConfigsSync('/absolute/path/to/config');
app.useConfig(configs);
```

Note: config files that read `Bun.env` capture their values from the
environment at macro-evaluation time. For bun build --compile this is the
CI/CD environment — the same intended behaviour as any immutable artifact.

## Parameters

### configDir

`string`

## Returns

`Record`\<`string`, `Record`\<`string`, `unknown`\>\>
