Skip to content

Commit 78ca4d2

Browse files
committed
chore: wip
1 parent ef71ef0 commit 78ca4d2

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

packages/bun-queue/src/config.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,18 @@ const defaultConfig: QueueConfig = {
2424
}
2525

2626
// Load unified config using bunfig
27-
// eslint-disable-next-line antfu/no-top-level-await
28-
export const config: QueueConfig = await loadConfig({
27+
// Lazy-loaded config to avoid top-level await (enables bun --compile)
28+
let _config: QueueConfig | null = null
29+
30+
export async function getConfig(): Promise<QueueConfig> {
31+
if (!_config) {
32+
_config = await loadConfig({
2933
name: 'queue',
3034
defaultConfig,
3135
})
36+
}
37+
return _config
38+
}
39+
40+
// For backwards compatibility - synchronous access with default fallback
41+
export const config: QueueConfig = defaultConfig

0 commit comments

Comments
 (0)