Files
Hippy/packages/hippy-debug-server/hippy-dev.js
T
2022-01-05 01:03:22 +08:00

36 lines
747 B
JavaScript
Executable File

#!/usr/bin/env node
const yargs = require('yargs');
const { webpack, getWebpackConfig } = require('./server/webpack');
const { argv } = yargs
.alias('v', 'version')
.describe('v', 'show version information')
.alias('h', 'help')
.alias('c', 'config')
.demand('config')
.help()
.version()
.option('config', {
type: 'string',
default: '',
describe: 'webpack config file',
})
.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
const webpackConfig = getWebpackConfig(argv.config);
webpack(webpackConfig);