Skip to content

Commit

Permalink
feat: Allow for settings.cwd to be used before process.cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
scagood committed Jan 2, 2024
1 parent 96e4956 commit a8d2687
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/util/import-target.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,10 @@ module.exports = class ImportTarget {
alias,
})

const cwd = this.context.settings?.cwd ?? process.cwd()
for (const directory of this.getPaths()) {
try {
const baseDir = resolve(process.cwd(), directory)
const baseDir = resolve(cwd, directory)
return requireResolve(baseDir, this.name)
} catch {
continue
Expand Down

0 comments on commit a8d2687

Please sign in to comment.