Skip to content

Commit

Permalink
feat: 🐛 support nohoist in package config (#13)
Browse files Browse the repository at this point in the history
* feat: 🐛 support nohoist in package config

Co-authored-by: tanzheng <[email protected]>
Co-authored-by: Matteo Mazzarolo <[email protected]>
  • Loading branch information
3 people authored Jun 24, 2022
1 parent 04acac9 commit 409c800
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/get-nohoist.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ module.exports = function getNohoist(params = {}) {
const packageJson = require(path.join(monorepoRoot, "package.json"));
const nohoistGlobs = packageJson.workspaces.nohoist || [];

// Also add nohoist values of "workspaces.nohoist" of the current workspace'
// package.json (if any).
const currentWorkspacePackageJson = require(path.join(cwd, "package.json"));
if (
currentWorkspacePackageJson &&
currentWorkspacePackageJson.workspaces &&
currentWorkspacePackageJson.workspaces.nohoist
) {
nohoistGlobs.push(...currentWorkspacePackageJson.workspaces.nohoist);
}

return nohoistGlobs
.map((nohoistGlob) =>
nohoistGlob.endsWith("/**")
Expand Down

0 comments on commit 409c800

Please sign in to comment.