Skip to content

Commit 2b3b7dd

Browse files
committed
try to use config.default before using config
1 parent 14d5a0a commit 2b3b7dd

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/lib/load-config.ts

+9-5
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ function lazyJiti() {
1919
}
2020

2121
export function loadConfig(path: string): Config {
22-
try {
23-
return path ? require(path) : {}
24-
} catch {
25-
return lazyJiti()(path)
26-
}
22+
let config = (function () {
23+
try {
24+
return path ? require(path) : {}
25+
} catch {
26+
return lazyJiti()(path)
27+
}
28+
})()
29+
30+
return config.default ?? config
2731
}

0 commit comments

Comments
 (0)