We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef71ef0 commit 78ca4d2Copy full SHA for 78ca4d2
packages/bun-queue/src/config.ts
@@ -24,8 +24,18 @@ const defaultConfig: QueueConfig = {
24
}
25
26
// Load unified config using bunfig
27
-// eslint-disable-next-line antfu/no-top-level-await
28
-export const config: QueueConfig = await loadConfig({
+// Lazy-loaded config to avoid top-level await (enables bun --compile)
+let _config: QueueConfig | null = null
29
+
30
+export async function getConfig(): Promise<QueueConfig> {
31
+ if (!_config) {
32
+ _config = await loadConfig({
33
name: 'queue',
34
defaultConfig,
35
})
36
+ }
37
+ return _config
38
+}
39
40
+// For backwards compatibility - synchronous access with default fallback
41
+export const config: QueueConfig = defaultConfig
0 commit comments