@hippy/debug-server
Version:
Dev server for hippy-core.
52 lines (45 loc) • 1.13 kB
JavaScript
#!/usr/bin/env node
const yargs = require('yargs');
const startDebugServer = require('./server');
const { argv } = yargs
.alias('v', 'version')
.describe('v', 'show version information')
.alias('h', 'help')
.help()
.version()
.option('entry', {
type: 'string',
default: 'dist/dev/index.bundle',
describe: 'Path of the jsbundle for debugging',
})
.option('static', {
type: 'string',
describe: 'Path of the static files such as images',
})
.option('host', {
type: 'string',
default: '0.0.0.0',
describe: 'The host the debug server will listen to',
})
.option('port', {
type: 'string',
default: '38989',
describe: 'The port for debug server will listen to',
})
.option('verbose', {
type: 'boolean',
default: false,
describe: 'Output error details',
})
.epilog(`Copyright (C) 2017-${new Date().getFullYear()} THL A29 Limited, a Tencent company.`);
if (argv.verbose) {
process.env.VERBOSE = true;
}
if (argv.help) {
yargs.showHelp().exit();
}
if (argv.version) {
yargs.version().exit();
}
// Execute command
startDebugServer(argv);