Skip to content

Commit 66adcf1

Browse files
committed
chore: wip
1 parent 385d534 commit 66adcf1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

packages/headwind/src/config.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,18 @@ export const defaultConfig: HeadwindConfig = {
185185
presets: [],
186186
}
187187

188-
// eslint-disable-next-line antfu/no-top-level-await
189-
export const config: HeadwindConfig = await loadConfig({
188+
// Lazy-loaded config to avoid top-level await (enables bun --compile)
189+
let _config: HeadwindConfig | null = null
190+
191+
export async function getConfig(): Promise<HeadwindConfig> {
192+
if (!_config) {
193+
_config = await loadConfig({
190194
name: 'headwind',
191195
defaultConfig,
192196
})
197+
}
198+
return _config
199+
}
200+
201+
// For backwards compatibility - synchronous access with default fallback
202+
export const config: HeadwindConfig = defaultConfig

0 commit comments

Comments
 (0)