Skip to content

Commit

Permalink
ignore subdependencies in findInstalledPackageJsonFile
Browse files Browse the repository at this point in the history
fix #47
  • Loading branch information
zvictor committed Aug 7, 2022
1 parent 95aaf8f commit 995a4ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/cli/src/utils/npm-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ function findInstalledPackageJsonFile(context: PlasmicContext, pkg: string) {
const rootDir = packageJsonPath
? path.dirname(packageJsonPath)
: context.rootDir;
const files = glob.sync(`${rootDir}/**/node_modules/${pkg}/package.json`);
const files = glob.sync(`${rootDir}/**/node_modules/${pkg}/package.json`, {
ignore:`**/node_modules/**/node_modules/**`
});
return files.length > 0 ? files[0] : undefined;
}

Expand Down

0 comments on commit 995a4ac

Please sign in to comment.