UNPKG

@procore/core-scripts

Version:

A CLI to enhance your development experience

33 lines 1.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const webpack_1 = tslib_1.__importDefault(require("webpack")); const library_1 = require("../../webpack/library"); const BaseCommand_1 = require("../../BaseCommand"); class LibStartCommand extends BaseCommand_1.BaseCommand { constructor() { super(...arguments); this.handler = (error, stats) => { if (error) { this.error(error); } this.log(stats === null || stats === void 0 ? void 0 : stats.toString({ chunks: false, colors: true })); }; } async run() { const config = (0, library_1.createWebpackConfig)({ env: 'development', workspace: this.workspace, }); const webpackConfig = config.toConfig(); const compiler = (0, webpack_1.default)(webpackConfig); const watchOptions = { aggregateTimeout: 300, poll: 1000, }; compiler.watch(watchOptions, this.handler); } } LibStartCommand.description = 'Compiles the library in development mode.'; exports.default = LibStartCommand; //# sourceMappingURL=start.js.map