ko
Version:
build & lint library
32 lines (31 loc) • 1.1 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const commander_1 = __importDefault(require("./commander"));
const hooks_1 = __importDefault(require("./hooks"));
const config_1 = __importDefault(require("./config"));
const types_1 = require("../types");
class Service extends hooks_1.default {
constructor() {
super();
this.commander = new commander_1.default();
this.config = new config_1.default().generate();
this.config.plugins &&
this.config.plugins.forEach(p => {
// MODIFY_WEBPACK only support UPDATE
if (p.key === types_1.HOOK_KEY_SET.MODIFY_WEBPACK) {
p.action = types_1.ACTION.UPDATE;
}
this.register(p);
});
}
freezeCliOptsWith(cliOpts) {
this.cliOpts = Object.freeze(cliOpts);
}
run() {
this.commander.parse();
}
}
exports.default = Service;