UNPKG

burdy

Version:

Open Source Headless Platform

35 lines (34 loc) 2.14 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const rimraf_1 = __importDefault(require("rimraf")); const webpack_1 = __importDefault(require("webpack")); const path_util_1 = __importDefault(require("./util/path.util")); const webpack_util_1 = require("./util/webpack.util"); const config_1 = __importDefault(require("../shared/features/config")); const webpack_config_1 = require("../webpack.config"); const scriptDbCliBuild = () => __awaiter(void 0, void 0, void 0, function* () { var _a; const dbBuildDirectory = path_util_1.default.cache('db-build'); yield (0, rimraf_1.default)(dbBuildDirectory, (error) => error && console.log(error)); const webpackServerConfig = (0, webpack_config_1.webpackServerConfigure)((webpackConfig) => { webpackConfig.entry = path_util_1.default.root('scripts', 'entry', 'db-cli'); webpackConfig.devtool = false; webpackConfig.output.path = dbBuildDirectory; return webpackConfig; }, (_a = config_1.default === null || config_1.default === void 0 ? void 0 : config_1.default.webpack) === null || _a === void 0 ? void 0 : _a.server); const serverCompiler = (0, webpack_1.default)(webpackServerConfig); yield (0, webpack_util_1.compilerRun)(serverCompiler); }); exports.default = scriptDbCliBuild;