'use strict';

var fs = require('fs-extra');
var createDistWorkspace = require('./createDistWorkspace-CLrZPAfL.cjs.js');
require('chalk');
require('path');
require('p-limit');
require('os');
require('tar');
require('lodash/partition');
require('./index-CCLafGQH.cjs.js');
require('commander');
require('semver');
require('@backstage/cli-common');
require('@backstage/errors');
require('./run-BcxUFacd.cjs.js');
require('child_process');
require('util');
require('rollup');
require('@rollup/plugin-commonjs');
require('@rollup/plugin-node-resolve');
require('rollup-plugin-postcss');
require('rollup-plugin-esbuild');
require('@svgr/rollup');
require('rollup-plugin-dts');
require('@rollup/plugin-json');
require('@rollup/plugin-yaml');
require('rollup-pluginutils');
require('./svgrTemplate-BTjBQ3by.cjs.js');
require('./entryPoints-CoHH4lBA.cjs.js');
require('@backstage/cli-node');
require('./parallel-BszNaKyc.cjs.js');
require('worker_threads');
require('./productionPack-DotlEIE2.cjs.js');
require('npm-packlist');

function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }

var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);

var buildWorkspace = async (dir, packages, options) => {
  if (!await fs__default.default.pathExists(dir)) {
    throw new Error(`Target workspace directory doesn't exist, '${dir}'`);
  }
  await createDistWorkspace.createDistWorkspace(packages, {
    targetDir: dir,
    alwaysYarnPack: options.alwaysYarnPack
  });
};

exports.default = buildWorkspace;
//# sourceMappingURL=buildWorkspace-DGKvYFIj.cjs.js.map
