diff --git a/lib/util/import-target.js b/lib/util/import-target.js index ee803530..1acb7b3f 100644 --- a/lib/util/import-target.js +++ b/lib/util/import-target.js @@ -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