UNPKG

@toreda/build-tools

Version:

![Toreda](https://content.toreda.com/logo/toreda-logo.png)

60 lines (59 loc) 2.2 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Cli = void 0; const yargs_1 = __importDefault(require("yargs")); class Cli { constructor(baseLog) { this.log = baseLog.makeLog('Cli'); } getArgs() { return (0, yargs_1.default)(process.argv.slice(2)).options({ autoMockInJest: { demand: false, type: 'boolean', default: true, describe: 'Automatically enable mocks for file operations when Jest is running.' }, env: { choices: ['prod', 'dev'], demand: false, default: 'prod', describe: 'Target build type or build environment.' }, profiler: { type: 'boolean', default: false, demand: false, describe: 'Run profiler. Slows build, but produces a detailed CPU usage report' }, debugMode: { type: 'boolean', default: false, demand: false, describe: 'Enable debug logging and debug data & symbols in webpacking. Disable for production builds.' }, mockAll: { type: 'boolean', default: false, demand: false, describe: 'Enable all mocks. Individual mock flags are ignored when true.' }, mockFileReads: { type: 'boolean', default: false, demand: false, describe: 'Use mocks for file reading instead of real file calls. Cannot read real files while active.' }, mockFileWrites: { type: 'boolean', default: false, demand: false, describe: 'Replace file write calls with mocks that return a specified value. Cannot write to real files while active.' } }).argv; } } exports.Cli = Cli;