feat(cli): support generate web-types (#5893) (#5903)

This commit is contained in:
neverland
2020-03-25 10:09:27 +08:00
committed by GitHub
parent c74fbf58a4
commit 5f16f1fb6d
6 changed files with 58 additions and 13 deletions

View File

@@ -1,15 +1,23 @@
import markdownVetur from '@vant/markdown-vetur';
import { join } from 'path';
import { get } from 'lodash';
import { SRC_DIR, getVantConfig, ROOT } from '../common/constant';
import {
ROOT,
SRC_DIR,
getVantConfig,
getPackageJson,
} from '../common/constant';
// generate vetur tags & attributes
export function genVeturConfig() {
const vantConfig = getVantConfig();
const pkgJson = getPackageJson();
const options = get(vantConfig, 'build.vetur');
if (options) {
markdownVetur.parseAndWrite({
name: vantConfig.name,
version: pkgJson.version,
path: SRC_DIR,
test: /zh-CN\.md/,
outputDir: join(ROOT, 'vetur'),