From 57d9f675e77768d0507b8d4e63b58aef29b2d600 Mon Sep 17 00:00:00 2001 From: Jacob Ebey Date: Thu, 4 Jun 2020 16:53:22 -0700 Subject: [PATCH] Use `process.cwd()` --- AutomaticVendorFederation.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AutomaticVendorFederation.js b/AutomaticVendorFederation.js index 0ca54d7..15bad9f 100644 --- a/AutomaticVendorFederation.js +++ b/AutomaticVendorFederation.js @@ -1,3 +1,5 @@ +const path = require('path'); + const AutomaticVendorFederation = ({ exclude, ignoreVersion, @@ -28,7 +30,8 @@ const AutomaticVendorFederation = ({ } ); return shareableDependencies.reduce((shared, pkg) => { - let packageVersion = require(pkg + "/package.json").version.split("."); + const p = path.resolve(process.cwd(), 'node_modules'); + let packageVersion = require(path.resolve(p, pkg + "/package.json")).version.split("."); if (ignorePatchVersion) { packageVersion.pop(); }