Skip to content

Commit

Permalink
fix: only ignore MODULE_NOT_FOUND when message contains configFile
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Apr 20, 2022
1 parent 76e0455 commit e067a56
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/loader.ts
Expand Up @@ -181,9 +181,13 @@ async function resolveConfig (source: string, opts: LoadConfigOptions): Promise<
res.config = await res.config()
}
} catch (err) {
if (err.code !== 'MODULE_NOT_FOUND') {
throw err
if (
err.code === 'MODULE_NOT_FOUND' &&
String(err).includes(opts.configFile)
) {
return res
}
throw err
}
return res
}

0 comments on commit e067a56

Please sign in to comment.