Skip to content

Commit

Permalink
fix: Fix error when nohoist is not defined (#10)
Browse files Browse the repository at this point in the history
Fix an error that occurs when nohoist is not defined as in Yarn 2 or 3 since nohoist is deprecated.
  • Loading branch information
kthompson authored Nov 8, 2021
1 parent 5a493d3 commit ffef661
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/get-nohoist.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function getNohoist(params = {}) {
: getWorkspaces({ cwd });
const monorepoRoot = getMonorepoRoot({ cwd });
const packageJson = require(path.join(monorepoRoot, "package.json"));
const nohoistGlobs = packageJson.workspaces.nohoist;
const nohoistGlobs = packageJson.workspaces.nohoist || [];

return nohoistGlobs
.map((nohoistGlob) =>
Expand Down

0 comments on commit ffef661

Please sign in to comment.