From 3ef2da0544e4a7fbe3ffc9ce05ce3fee03a18e2e Mon Sep 17 00:00:00 2001 From: Konstantin M Date: Sun, 12 Apr 2020 08:22:45 +0200 Subject: [PATCH] Fix issue with package.json inference when using the `cwd` option (#107) --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 6469229..6be7759 100644 --- a/index.js +++ b/index.js @@ -53,7 +53,7 @@ class Conf { }; const getPackageData = onetime(() => { - const packagePath = pkgUp.sync(parentDir); + const packagePath = pkgUp.sync({cwd: parentDir}); // Can't use `require` because of Webpack being annoying: // https://github.com/webpack/webpack/issues/196 const packageData = packagePath && JSON.parse(fs.readFileSync(packagePath, 'utf8'));