feat(cli): add --version option

This commit is contained in:
陈嘉涵 2020-01-18 07:52:12 +08:00
parent ef1916c320
commit fa9a64b480

View File

@ -1,6 +1,10 @@
#!/usr/bin/env node
import { command, parse, version } from 'commander';
import { command, parse } from 'commander';
// @ts-ignore
import packageJson from '../package.json';
// commands
import { dev } from './commands/dev';
import { lint } from './commands/lint';
import { test } from './commands/jest';
@ -11,6 +15,8 @@ import { changelog } from './commands/changelog';
import { buildSite } from './commands/build-site';
import { commitLint } from './commands/commit-lint';
version(`@vant/cli ${packageJson.version}`);
command('dev')
.description('Run webpack dev server')
.action(dev);