Skip to content

Commit af3fa11

Browse files
committed
fix: log error if config loading fails
1 parent df14f3c commit af3fa11

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ export const loadFile = <T>(file: string, cwd = process.cwd()): T => {
4444

4545
// eslint-disable-next-line @typescript-eslint/no-var-requires
4646
return require(moduleId) as T
47+
} catch (error) {
48+
console.error(
49+
kleur.red(
50+
`Failed to to load ${kleur.bold(Path.relative(process.cwd(), moduleId))}: ${error.message}`,
51+
),
52+
)
4753

4854
return {} as T
4955
}

0 commit comments

Comments
 (0)