Skip to content

Commit

Permalink
Fix import-js#666: resolve config from source file
Browse files Browse the repository at this point in the history
when a relative `configPath` is passed, it should be resolved relative to the source file, not the imported file.
  • Loading branch information
Billy- authored Jan 5, 2018
1 parent 2470ed7 commit 0b10ed1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resolvers/webpack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ exports.resolve = function (source, file, settings) {
// see if we've got an absolute path
if (!configPath || !isAbsolute(configPath)) {
// if not, find ancestral package.json and use its directory as base for the path
packageDir = findRoot(path.resolve(file))
packageDir = findRoot(path.resolve(source))
if (!packageDir) throw new Error('package not found above ' + file)
}

Expand Down

0 comments on commit 0b10ed1

Please sign in to comment.