feat(cli): gen vetur config

This commit is contained in:
陈嘉涵
2019-12-13 09:50:29 +08:00
parent adbaf9b69e
commit 8fc7e6e611
3 changed files with 29 additions and 4 deletions
@@ -0,0 +1,20 @@
// @ts-ignore
import markdownVetur from '@vant/markdown-vetur';
import { join } from 'path';
import { get } from 'lodash';
import { SRC_DIR, getVantConfig, ROOT } from '../common/constant';
// generate vetur tags & attributes
export function genVeturConfig() {
const vantCongig = getVantConfig();
const options = get(vantCongig, 'build.vetur');
if (options) {
markdownVetur.parseAndWrite({
path: SRC_DIR,
test: /zh-CN\.md/,
outputDir: join(ROOT, 'vetur'),
...options
});
}
}