@macrof/cli
Version:
React MicroFrontend compiler, Typescript, Webpack 5, ModuleFederation
32 lines (27 loc) • 716 B
JavaScript
const Yargs = require('yargs');
const createShellJson = require('./createShellJson');
const createShellJsonCommand = {
command: 'createShellJson',
describe: '- Create production MF Json file from mf.default.json',
handler() {
try {
createShellJson();
console.log('[command (mfcli createShellJson)]: Success');
} catch (e) {
console.log(e)
}
}
};
const defaultCommand = {
command: '*',
handler() {
console.log('You need at least one command before moving on');
Yargs.showHelp();
}
};
Yargs
.command(createShellJsonCommand)
.command(defaultCommand)
.demandCommand()
.argv;