Browse Source

Merge pull request #6689 from jasongrout/utilsworkspaces

Support yarn configs with plain workspaces lists.
Steven Silvester 5 years ago
parent
commit
102dca5a95
1 changed files with 2 additions and 1 deletions
  1. 2 1
      buildutils/src/utils.ts

+ 2 - 1
buildutils/src/utils.ts

@@ -15,7 +15,8 @@ export function getLernaPaths(basePath = '.'): string[] {
   basePath = path.resolve(basePath);
   basePath = path.resolve(basePath);
   let baseConfig = require(path.join(basePath, 'package.json'));
   let baseConfig = require(path.join(basePath, 'package.json'));
   let paths: string[] = [];
   let paths: string[] = [];
-  for (let config of baseConfig.workspaces.packages) {
+  let packages = baseConfig.workspaces.packages || baseConfig.workspaces;
+  for (let config of packages) {
     paths = paths.concat(glob.sync(path.join(basePath, config)));
     paths = paths.concat(glob.sync(path.join(basePath, config)));
   }
   }
   return paths.filter(pkgPath => {
   return paths.filter(pkgPath => {