"use strict";

var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");

var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");

_Object$defineProperty(exports, "__esModule", {
  value: true
});

exports.default = void 0;

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));

var _plugin = _interopRequireDefault(require("@start/plugin"));

var _exec = _interopRequireDefault(require("@lerna/exec"));

var _default = watch => (0, _plugin.default)('BUILD PACKAGES', ({
  reporter
}) => /*#__PURE__*/(0, _asyncToGenerator2.default)(function* () {
  const args = ['src --out-dir lib --root-mode upward-optional --copy-files'];

  if (watch) {
    args.push('--watch');
  }

  return (0, _exec.default)({
    cmd: 'babel',
    args: args,
    parallel: true
  });
}));

exports.default = _default;
module.exports = exports.default;