UNPKG

@blitzjs/cli

Version:
39 lines (38 loc) 1.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Export = void 0; const tslib_1 = require("tslib"); const command_1 = require("@oclif/command"); class Export extends command_1.Command { run() { return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { const config = { rootFolder: process.cwd(), env: "prod", }; this.parse(Export); try { const { blitzExport } = yield Promise.resolve().then(() => (0, tslib_1.__importStar)(require("@blitzjs/server"))); yield blitzExport(config); } catch (err) { console.error(err); process.exit(1); // clean up? } }); } } exports.Export = Export; Export.description = "Exports a static page"; Export.aliases = ["e"]; Export.flags = { help: command_1.flags.help({ char: "h" }), outdir: command_1.flags.string({ char: "o", description: "set the output dir (defaults to 'out')", }), env: command_1.flags.string({ char: "e", description: "Set app environment name", }), };